Dirichlet | R Documentation |
Density and random generation for the Dirichlet distribution
ddirch(x, alpha, log = FALSE)
rdirch(n = 1, alpha)
x |
vector of values. |
alpha |
vector of parameters of same length as |
log |
logical; if TRUE, probability density is returned on the log scale. |
n |
number of observations (only |
See Gelman et al., Appendix A or the BUGS manual for mathematical details.
ddirch
gives the density and rdirch
generates random deviates.
Christopher Paciorek
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.