| Title: | Spherical Dirichlet Distribution |
|---|---|
| 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>. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-11-22 01:14:12 UTC |
| Source: | https://github.com/cran/spherDir |
Maximum likelihood estimation, regression analysis, random values generation, and other functions for the spherical Dirichlet distribution.
| Package: | spherDir |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-11-02 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
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.
dsdd(y, a, logged = FALSE)dsdd(y, a, logged = FALSE)
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. |
The density values of the zero adjusted Dirichlet distribution are computed.
A vector with the density values.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
y <- as.matrix(iris[, 1:3]) y <- y / rowSums(y) y <- sqrt(y) mod <- sdd.mle(y) den <- dsdd(y, mod$a)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.
sdd.mle(y, tol = 1e-7)sdd.mle(y, tol = 1e-7)
y |
A matrix with the compositional data. |
tol |
The tolerance value to terminate the Newton-Raphson algorithm. |
A spherical Dirichlet distribution is being fitted and its parameters are estimated.
A list including:
loglik |
The value of the log-likelihood. |
a |
The parameters of the distribution. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
y <- as.matrix(iris[, 1:3]) y <- y / rowSums(y) y <- sqrt(y) mod <- sdd.mle(y)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.
rsdd(n, a)rsdd(n, a)
n |
The number of compositional vectors to simulate. |
a |
The parameters of the spherical Dirichlet distribution. |
Random values from the spherical Dirichlet distribution are generated.
A matrix with values generated from the spherical Dirichlet distribution.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
y <- as.matrix(iris[, 1:3]) y <- y / rowSums(y) y <- sqrt(y) mod <- sdd.mle(y) x <- rsdd(100, mod$a)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.
sdd.reg(y, x, xnew = NULL, tol = 1e-6, maxit = 100)sdd.reg(y, x, xnew = NULL, tol = 1e-6, maxit = 100)
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. |
A spherical Dirichlet regression is being fitted.
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). |
Michail Tsagris and Christos Adam.
R implementation and documentation: Michail Tsagris [email protected].
Harris J. and Guardiola J. (2026). Inferential methods for the spherical-Dirichlet distribution. Communications in Statistics-Theory and Methods, 55(23): 8245–8269.
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)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)