View source: R/stick_breaking.R
StickBreaking | R Documentation |
A Dirichlet process can be represented using a stick breaking construction
G = \sum _{i=1} ^n pi _i \delta _{\theta _i}
,
where \pi _k = \beta _k \prod _{k=1} ^{n-1} (1- \beta _k )
are the stick breaking weights.
The atoms \delta _{\theta _i}
are drawn from G_0
the base measure of the Dirichlet Process.
The \beta _k \sim \mathrm{Beta} (1, \alpha)
. In theory n
should be infinite, but we chose some value of N
to truncate
the series. For more details see reference.
StickBreaking(alpha, N)
piDirichlet(betas)
alpha |
Concentration parameter of the Dirichlet Process. |
N |
Truncation value. |
betas |
Draws from the Beta distribution. |
Vector of stick breaking probabilities.
piDirichlet()
: Function for calculating stick lengths.
Ishwaran, H., & James, L. F. (2001). Gibbs sampling methods for stick-breaking priors. Journal of the American Statistical Association, 96(453), 161-173.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.