Learn R Programming

bbricks (version 0.1.1)

dPosteriorPredictive.CatHDP2: Posterior predictive density function of a "CatHDP" object

Description

Generate the the density value of the posterior predictive distribution of the following structure: G_m |eta ~ DP(eta,U), m = 1:M G_mj|gamma ~ DP(gamma,G_m), j = 1:J_m pi_mj|G_mj,alpha ~ DP(alpha,G_mj) z|pi_mj ~ Categorical(pi_mj) k|z,G_mj ~ Categorical(G_mj), if z is a sample from the base measure G_mj u|k,G_m ~ Categorical(G_m), if k is a sample from the base measure G_m where DP(eta,U) is a Dirichlet Process on positive integers, eta is the "concentration parameter", U is the "base measure" of this Dirichlet process, U is an uniform distribution on all positive integers. DP(gamma,G_m) is a Dirichlet Process on integers with concentration parameter gamma and base measure G_m. DP(alpha,G_mj) is a Dirichlet Process on integers with concentration parameter alpha and base measure G_mj. In the case of CatHDP2, u, 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 u,z,k|alpha,gamm,eta,U,G_mj,G_m.

Usage

# S3 method for CatHDP2
dPosteriorPredictive(obj, u, k, z, m, j, LOG = TRUE, ...)

Arguments

obj

A "CatHDP" object.

u

integer, the elements of the vector must all greater than 0, the samples of a Categorical distribution.

k

integer, the elements of the vector must all greater than 0, the samples of a Categorical distribution.

z

integer, the elements of the vector must all greater than 0, the samples of a Categorical distribution.

m

integer, group label.

j

integer, subgroup label.

LOG

Return the log density if set to "TRUE".

...

Additional arguments to be passed to other inherited types.

Value

A numeric vector, the posterior predictive density.

References

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

See Also

@seealso CatHDP, dPosteriorPredictive.CatHDP