CatHDP: Create objects of type "CatHDP".

Description Usage Arguments Value References See Also Examples

View source: R/Dirichlet_Process.r

Description

Create an object of type "CatHDP", which represents the Categorical-Hierarchical-Dirichlet-Process(Multinomial-Hierarchical-Dirichlet-Process) conjugate structure on positive integers:

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.
This object will be used as a place for recording and accumulating information in the related inference/sampling functions such as posterior(), posteriorDiscard(), rPosteriorPredictive() and so on.

Usage

1
2
3
4
5
CatHDP(
  objCopy = NULL,
  ENV = parent.frame(),
  gamma = list(gamma = 1, alpha = 1, j = 2)
)

Arguments

objCopy

an object of type "CatHDP". If "objCopy" is not NULL, the function create a new "CatHDP" object by copying the content from objCopy, otherwise this new object will be created by using "ENV" and "gamma". Default NULL.

ENV

environment, specify where the object will be created.

gamma

list, a named list of parameters, gamma=list(gamma,alpha,j). Where gamma$gamma is a numeric value specifying the concentration parameter of DP(gamma,U), gamma$alpha is a numeric value specifying the concentration parameter of DP(alpha,G), gamma$j is the number of groups J.

Value

An object of class "CatHDP".

References

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

See Also

posterior.CatHDP,posteriorDiscard.CatHDP ...

Examples

1
2
obj <- CatHDP(gamma=list(gamma=1,alpha=1,j=2))
obj #print the content

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