powered by
Density and random generation for the Dirichlet distribution
ddirch(x, alpha, log = FALSE)rdirch(n = 1, alpha)
rdirch(n = 1, alpha)
ddirch gives the density and rdirch generates random deviates.
ddirch
rdirch
vector of values.
vector of parameters of same length as x
x
logical; if TRUE, probability density is returned on the log scale.
number of observations (only n=1 is handled currently).
n=1
Christopher Paciorek
See Gelman et al., Appendix A or the BUGS manual for mathematical details.
Gelman, A., Carlin, J.B., Stern, H.S., and Rubin, D.B. (2004) Bayesian Data Analysis, 2nd ed. Chapman and Hall/CRC.
Distributions for other standard distributions
alpha <- c(1, 10, 30) x <- rdirch(1, alpha) ddirch(x, alpha)
Run the code above in your browser using DataLab