Generate random samples from the posterior distribution of the following structure:
?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).
# S3 method for CatDirichlet
rPosterior(obj, n = 1, ...)
A "CatDirichlet" object.
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.
# NOT RUN {
obj <- CatDirichlet(gamma=list(alpha=rep(1,26),uniqueLabels = letters))
rPosterior(obj = obj,n=3)
# }
Run the code above in your browser using DataLab