Description Usage Arguments Value See Also Examples
View source: R/Categorical_Inference.r
Generate random samples from the posterior distribution of the following structure:
pi|alpha \sim Dir(alpha)
x|pi \sim Categorical(pi)
Where Dir() is the Dirichlet distribution, Categorical() is the Categorical distribution. See ?dDir
and dCategorical
for the definitions of these distribution.
The model structure and prior parameters are stored in a "CatDirichlet" object.
Posterior distribution is Dir(pi|alpha).
1 2 | ## S3 method for class 'CatDirichlet'
rPosterior(obj, n = 1, ...)
|
obj |
A "CatDirichlet" object. |
n |
integer, the number of samples to be generated. |
... |
Additional arguments to be passed to other inherited types. |
A matrix, each row is a sample of pi.
CatDirichlet
, dPosterior.CatDirichlet
1 2 | obj <- CatDirichlet(gamma=list(alpha=rep(1,26),uniqueLabels = letters))
rPosterior(obj = obj,n=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.