| ddirmult | R Documentation |
Density function for the Dirichlet-multinomial distribution.
ddirmult(x, p, theta, alpha, log = FALSE)
x |
Numeric vector or matrix of counts. If matrix, then a vector of probability densities is returned with an element for each record of the matrix. Matrix records represent observations, and matrix fields represent dimensions. |
p |
Numeric vector or matrix of proportions. Matrix records represent observations, and matrix fields represent dimensions. If vector, then |
theta |
Numeric vector. Precision parameter with domain ( |
alpha |
Numeric vector or matrix of conventional alpha values. Matrix records represent observations, and matrix fields represent dimensions. If vector, then |
log |
Logical scalar. If |
Computes the probability mass of the Dirichlet-multinomial distribution. Under the proportion parameterization, the alpha parameters of the conventional Dirichlet-multinomial distribution are derived as the product of a proportion vector (p) and an exponentiated precision parameter (exp(theta)). The precision parameter controls the degree of overdispersion relative to the multinomial distribution, where higher values of theta are associated with reduced overdispersion. When theta = 0, the alpha parameters of the conventional Dirichlet-multinomial distribution are equal to the proportion vector (p). To ensure a simplex, the values of p (vector or matrix records) are internally normalized to sum to one. If alpha is provided, then the conventional alpha parameterization of the Dirichlet-multinomial distribution is used.
Numeric vector of probability densities.
Minka TP. 2000. Estimating a Dirichlet distribution.
waic for generic function to compute widely applicable information criterion.
dmWAIC for computing widely applicable information criteria for Dirichlet-multinomial regression models.
# Compute log probability density.
ddirmult(x=c(33,115,95,359),
p=c(0.075,0.201,0.175,0.549),
theta=4.027,log=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.