CatDP {bbricks}R Documentation

Create objects of type "CatDP".


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

pi|alpha \sim DP(alpha,U)

x|pi \sim Categorical(pi)

where DP(alpha,U) is a Dirichlet Process on positive integers, alpha is the "concentration parameter" of the Dirichlet Process, U is the "base measure" of this Dirichlet process, it is an uniform distribution on all positive integers.Categorical() is the Categorical distribution. See dCategorical for the definition of the Categorical distribution.
In the case of CatDP, x 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(), MAP(), marginalLikelihood(), dPosteriorPredictive(), rPosteriorPredictive() and so on.


CatDP(objCopy = NULL, ENV = parent.frame(), gamma = list(alpha = 1))



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


environment, specify where the object will be created.


list, a named list of parameters, gamma=list(alpha). Where gamma$alpha is a numeric value specifying the concentration parameter of the Dirichlet Process.


An object of class "CatDP".


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

See Also

posterior.CatDP,posteriorDiscard.CatDP,MAP.CatDP,marginalLikelihood.CatDP, dPosteriorPredictive.CatDP, rPosteriorPredictive.CatDP


obj <- CatDP(gamma=list(alpha=2))
obj #print the content

[Package bbricks version 0.1.4 Index]