Description Usage Arguments Value References See Also Examples
View source: R/Categorical_Inference.r
Generate random samples from the posterior predictive 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 predictive is a distribution of x|alpha
1 2 | ## S3 method for class 'CatDirichlet'
rPosteriorPredictive(obj, n, ...)
|
obj |
A "CatDirichlet" object. |
n |
integer, number of samples. |
... |
Additional arguments to be passed to other inherited types. |
A vector of the same type as obj$gamma$uniqueLabels.
Murphy, Kevin P. Machine learning: a probabilistic perspective. MIT press, 2012.
CatDirichlet
, dPosteriorPredictive.CatDirichlet
1 2 | obj <- CatDirichlet(gamma=list(alpha=runif(26,1,2),uniqueLabels = letters))
rPosteriorPredictive(obj=obj,n=200)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.