rPosteriorPredictive.CatHDP {bbricks}R Documentation

Generate random samples from the posterior predictive distribution of a "CatHDP" object

Description

Generate random samples from the posterior predictive distribution of the following structure:

G|gamma \sim DP(gamma,U)

pi_j|G,alpha \sim DP(alpha,G), j = 1:J

z|pi_j \sim Categorical(pi_j)

k|z,G \sim Categorical(G), \textrm{ if z is a sample from the base measure G}

where DP(gamma,U) is a Dirichlet Process on positive integers, gamma is the "concentration parameter", U is the "base measure" of this Dirichlet process, U is an uniform distribution on all positive integers. DP(alpha,G) is a Dirichlet Process on integers with concentration parameter alpha and base measure G. Categorical() is the Categorical distribution. See dCategorical for the definition of the Categorical distribution.
In the case of CatHDP, z and k can only be positive integers.
The model structure and prior parameters are stored in a "CatHDP" object.
Posterior predictive is a distribution of z,k|alpha,gamma,U.

Usage

## S3 method for class 'CatHDP'
rPosteriorPredictive(obj, n = 1L, j, ...)

Arguments

obj

A "CatHDP" object.

n

integer, number of samples.

j

integer, group label.

...

Additional arguments to be passed to other inherited types.

Value

integer, the categorical samples.

References

Teh, Yee W., et al. "Sharing clusters among related groups: Hierarchical Dirichlet processes." Advances in neural information processing systems. 2005.

See Also

CatHDP, dPosteriorPredictive.CatHDP


[Package bbricks version 0.1.4 Index]