rPosterior.CatDirichlet: Generate ramdom samples from the posterior distribution of a "CatDirichlet" object
Description
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).
Usage
# S3 method for CatDirichlet
rPosterior(obj, n = 1, ...)
Arguments
obj
A "CatDirichlet" object.
n
integer, the number of samples to be generated.
...
Additional arguments to be passed to other inherited types.