rPosteriorPredictive.CatHDP: Generate random samples from the posterior predictive...

Description Usage Arguments Value References See Also

View source: R/Dirichlet_Process.r

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

1
2
## 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


bbricks documentation built on July 8, 2020, 7:29 p.m.