Last chance! 50% off unlimited learning
Sale ends in
This is the density function and random generation from the Dirichlet distribution.
ddirichlet(x, alpha, log=FALSE)
rdirichlet(n, alpha)
This is a vector containing a single deviate or matrix containing one random deviate per row. Each vector, or matrix row, must sum to 1.
This is the number of random deviates to generate.
This is a vector or matrix of shape parameters.
Logical. If log=TRUE
, then the logarithm of the
density is returned.
ddirichlet
gives the density and
rdirichlet
generates random deviates.
Application: Continuous Multivariate
Density:
Inventor: Johann Peter Gustav Lejeune Dirichlet (1805-1859)
Notation 1:
Notation 2:
Notation 3:
Notation 4:
Parameter: 'prior sample sizes'
Mean:
Variance:
Covariance:
Mode:
The Dirichlet distribution is the multivariate generalization of the
univariate beta distribution. Its probability density function returns
the belief that the probabilities of
The Dirichlet distribution is commonly used as a prior distribution in Bayesian inference. The Dirichlet distribution is the conjugate prior distribution for the parameters of the categorical and multinomial distributions.
A very common special case is the symmetric Dirichlet distribution,
where all of the elements in parameter vector
dbeta
,
dcat
,
dmvpolya
,
dmultinom
, and
TransitionMatrix
.
# NOT RUN {
library(LaplacesDemon)
x <- ddirichlet(c(.1,.3,.6), c(1,1,1))
x <- rdirichlet(10, c(1,1,1))
# }
Run the code above in your browser using DataLab