Learn R Programming

bbricks (version 0.1.1)

rPosteriorPredictive.CatDirichlet: Posterior predictive random generation of a "CatDirichlet" object

Description

Generate random samples from the posterior predictive distribution of the following structure: pi|alpha ~ Dirichlet(alpha) x|pi ~ Categorical(pi) the model structure and prior parameters are stored in a "CatDirichlet" object posterior predictive is a distribution of x|alpha

Usage

# S3 method for CatDirichlet
rPosteriorPredictive(obj, n, ...)

Arguments

obj

A "CatDirichlet" object.

n

integer, number of samples.

...

Additional arguments to be passed to other inherited types.

Value

A vector of the same type as obj$gamma$uniqueLabels.

References

Murphy, Kevin P. Machine learning: a probabilistic perspective. MIT press, 2012.

See Also

@seealso CatDirichlet, dPosteriorPredictive.CatDirichlet

Examples

Run this code
# NOT RUN {
obj <- CatDirichlet(gamma=list(alpha=runif(26,1,2),uniqueLabels = letters))
rPosteriorPredictive(obj=obj,n=200)
# }

Run the code above in your browser using DataLab