rDir | R Documentation |
Simulates from a Dirichlet distribution with concentration parameter
vector \alpha
= (\alpha_1
, ..., \alpha_K
).
rDir(n = 1, alpha = c(1, 1))
n |
A numeric scalar. The size of sample required. |
alpha |
A numeric vector. Dirichlet concentration parameter. |
The simulation is based on the property that if
Y_1, \ldots, Y_K
are independent, Y_i
has a
gamma(\alpha_i
, 1) distribution and
S = Y_1 + \cdots + Y_k
then (Y_1, \ldots, Y_K) / S
has a
Dirichlet(\alpha_1
, ..., \alpha_K
) distribution.
See https://en.wikipedia.org/wiki/Dirichlet_distribution#Gamma_distribution
An n
by length(alpha)
numeric matrix.
Kotz, S., Balakrishnan, N. and Johnson, N. L. (2000) Continuous Multivariate Distributions, vol. 1, Models and Applications, 2nd edn, ch. 49. New York: Wiley. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/0471722065")}
rprior_prob
for prior simulation of
GEV parameters - prior on probability scale.
rDir(n = 10, alpha = 1:4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.