dirichlet-distribution {Boom} | R Documentation |
The Dirichlet Distribution
Description
Density and random generation for the Dirichlet distribution.
Usage
ddirichlet(probabilities, nu, logscale = FALSE)
rdirichlet(n, nu)
Arguments
probabilities |
A vector representing a discrete probability distribution, or a matrix where each row is a discrete probability distribution. Zero probabilities are not allowed. |
nu |
The parameters of the Dirichlet distribution. This can be a
vector of positive numbers, interpretable as prior counts, of length
matching the dimension of probabilities. If |
logscale |
Logical. If TRUE then return the density on the log scale. Otherwise return the density on the raw scale. |
n |
The number of desired draws. |
Details
The Dirichlet distribution is a generalization of the beta distribution. Whereas beta distribution is a model for probabilities, the Dirichlet distribution is a model for discrete distributions with several possible outcome values.
Let denote a discrete probability distribution (a vector
of positive numbers summing to 1), and let
be a vector
of positive numbers (the parameters of the Dirichlet distribution),
which can be thought of as prior counts. Then the density of the
Dirichlet distribution can be written
Value
ddirichlet
returns a vector of density values, with one
entry per row in probabilities
. rdirichlet
returns a
matrix (if n > 1
) or a vector (if n==1
) containing the
draws from the Dirichlet distribution with the specified parameters.
Author(s)
Steven L. Scott steve.the.bayesian@gmail.com
References
Gelman, Carlin, Stern, Rubin (2003), "Bayesian Data Analysis", Chapman and Hall.