Fits a Dirichlet distribution to a matrix of compositions.
dirichlet(link = "loge", parallel = FALSE, zero = NULL, imethod = 1)
Link function applied to each of the Links
for more choices.
The default gives
See CommonVGAMffArguments
for more information.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
When fitted, the fitted.values
slot of the object contains the
In this help file the response is assumed to be a
The Dirichlet distribution is commonly used to model compositional
data, including applications in genetics.
Suppose
The Dirichlet distribution can be motivated by considering the random variables
Lange, K. (2002) Mathematical and Statistical Methods for Genetic Analysis, 2nd ed. New York: Springer-Verlag.
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011) Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
# NOT RUN {
ddata <- data.frame(rdiric(n = 1000,
shape = exp(c(y1 = -1, y2 = 1, y3 = 0))))
fit <- vglm(cbind(y1, y2, y3) ~ 1, dirichlet,
data = ddata, trace = TRUE, crit = "coef")
Coef(fit)
coef(fit, matrix = TRUE)
head(fitted(fit))
# }
Run the code above in your browser using DataLab