Description Usage Arguments Details Value Note References Examples
Generate draws from a random Dirichlet distribution or compute its density.
1 2 | rdirichlet(n, alpha)
ddirichlet(x, alpha)
|
n |
Number of draws |
alpha |
Scale matrix, h x h |
x |
value to compute density |
Draws n values for an h x h Dirichlet random variable or computes the density.
x |
An n x h matrix of the draws |
Based on code from Kevin Quinn in the MCMCpack package and the gregmisc package.
MCMCpack and gregmisc
1 | rdirichlet(2, matrix(rep(1, 4), 2, 2))
|
##
## MSBVAR Package v.0.9-2
## Build date: Fri May 10 08:07:03 2019
## Copyright (C) 2005-2019, Patrick T. Brandt
## Written by Patrick T. Brandt
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0351179, SES-0351205, SES-0540816, and SES-0921051)
##
[,1] [,2] [,3] [,4]
[1,] 0.74271508 0.01906666 0.2046823 0.03353597
[2,] 0.05777596 0.25311355 0.6382755 0.05083500
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.