[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
19.27 The Dirichlet Distribution
- Function: void gsl_ran_dirichlet (const gsl_rng * r, size_t K, const double alpha[], double theta[])
This function returns an array of K random variates from a Dirichlet distribution of order K-1. The distribution function is for theta_i >= 0 and alpha_i >= 0. The delta function ensures that \sum \theta_i = 1. The normalization factor Z is
The random variates are generated by sampling K values from gamma distributions with parameters a=alpha_i, b=1, and renormalizing. See A.M. Law, W.D. Kelton, Simulation Modeling and Analysis (1991).
- Function: double gsl_ran_dirichlet_pdf (size_t K, const double alpha[], const double theta[])
This function computes the probability density p(\theta_1, ... , \theta_K) at theta[K] for a Dirichlet distribution with parameters alpha[K], using the formula given above.
- Function: double gsl_ran_dirichlet_lnpdf (size_t K, const double alpha[], const double theta[])
This function computes the logarithm of the probability density p(\theta_1, ... , \theta_K) for a Dirichlet distribution with parameters alpha[K].