CatDP {bbricks}R Documentation

Create objects of type "CatDP".

Description

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.

Usage

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

Arguments

objCopy

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.

ENV

environment, specify where the object will be created.

gamma

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

Value

An object of class "CatDP".

References

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

Examples

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

[Package bbricks version 0.1.4 Index]