| Type: | Package |
| Title: | Spherical Dirichlet Distribution |
| Version: | 1.0 |
| Maintainer: | Michail Tsagris <mtsagris@uoc.gr> |
| Depends: | R (≥ 4.0) |
| Imports: | Compositional, Rfast, stats |
| Suggests: | Rfast2 |
| Description: | Maximum likelihood estimation, regression analysis, random values generation, and other functions for the spherical Dirichlet distribution. The relevant paper is Harris and Guardiola (2026) <doi:10.1080/03610926.2026.2722098>. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Encoding: | UTF-8 |
| NeedsCompilation: | no |
| Packaged: | 2026-11-02 09:05:25 UTC; mtsag |
| Author: | Michail Tsagris [aut, cre] |
| Repository: | CRAN |
| Date/Publication: | 2026-11-21 19:00:02 UTC |
Spherical Dirichlet Distribution
Description
Maximum likelihood estimation, regression analysis, random values generation, and other functions for the spherical Dirichlet distribution.
Details
| Package: | spherDir |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-11-02 |
Maintainers
Michail Tsagris <mtsagris@uoc.gr>.
Author(s)
Michail Tsagris mtsagris@uoc.gr
References
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
Density values of the zero adjusted Dirichlet distribution
Description
Density values of the zero adjusted Dirichlet distribution.
Usage
dsdd(y, a, logged = FALSE)
Arguments
y |
A matrix with compositional data with zero values. |
a |
The parameters of the spherical Dirichlet distribution. |
logged |
A boolean variable specifying whether the logarithm of the density values to be returned. It is set to TRUE by default. |
Details
The density values of the zero adjusted Dirichlet distribution are computed.
Value
A vector with the density values.
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
See Also
Examples
y <- as.matrix(iris[, 1:3])
y <- y / rowSums(y)
y <- sqrt(y)
mod <- sdd.mle(y)
den <- dsdd(y, mod$a)
MLE of the spherical Dirichlet distribution
Description
MLE of the spherical Dirichlet distribution.
Usage
sdd.mle(y, tol = 1e-7)
Arguments
y |
A matrix with the compositional data. |
tol |
The tolerance value to terminate the Newton-Raphson algorithm. |
Details
A spherical Dirichlet distribution is being fitted and its parameters are estimated.
Value
A list including:
loglik |
The value of the log-likelihood. |
a |
The parameters of the distribution. |
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
See Also
Examples
y <- as.matrix(iris[, 1:3])
y <- y / rowSums(y)
y <- sqrt(y)
mod <- sdd.mle(y)
Random values simulation from the spherical Dirichlet distribution
Description
Random values simulation from the spherical Dirichlet distribution.
Usage
rsdd(n, a)
Arguments
n |
The number of compositional vectors to simulate. |
a |
The parameters of the spherical Dirichlet distribution. |
Details
Random values from the spherical Dirichlet distribution are generated.
Value
A matrix with values generated from the spherical Dirichlet distribution.
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
See Also
Examples
y <- as.matrix(iris[, 1:3])
y <- y / rowSums(y)
y <- sqrt(y)
mod <- sdd.mle(y)
x <- rsdd(100, mod$a)
Spherical Dirichlet regression
Description
Spherical Dirichlet regression.
Usage
sdd.reg(y, x, xnew = NULL, tol = 1e-6, maxit = 100)
Arguments
y |
A matrix with the compositional data (dependent variable). The number of observations (vectors) with no zero values should be more than the columns of the predictor variables. Otherwise, the initial values will not be calculated. |
x |
The predictor variable(s), they can be either continnuous or categorical or both. |
xnew |
If you have new data use it, otherwise leave it NULL. |
tol |
The tolerance value to terminate the Newton-Raphson algorithm. |
maxit |
The maximum number of iterations allowed in the Newton-Raphson algortihm. |
Details
A spherical Dirichlet regression is being fitted.
Value
A list including:
runtime |
The time required by the regression. |
loglik |
The value of the log-likelihood. |
iters |
The iterations required by the IRLS algorithm. |
phi |
The precision parameter, |
be |
The beta coefficients. |
seb |
The standard error of the beta coefficients. |
sigma |
Th covariance matrix of the regression parameters (for the mean vector and the |
est |
The fitted or the predicted values (if xnew is not NULL). |
Author(s)
Michail Tsagris and Christos Adam.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
See Also
Examples
x <- as.vector(iris[, 4])
y <- as.matrix(iris[, 1:3])
y <- y / rowSums(y)
y <- sqrt(y)
mod <- sdd.mle(y)
mod1 <- sdd.reg(y, x)