Learn R Programming

bbricks (version 0.1.1)

MPE.CatDP: Mean Posterior Estimate(MPE) of a "CatDP" object

Description

Generate the MPE estimate of "pi" in following model structure: pi|alpha ~ DP(alpha,U) x|pi ~ 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. In the case of CatDP, x can only be positive integers. The model structure and prior parameters are stored in a "CatDP" object. MPE is pi_MPE = E(pi|alpha,x), E() is the expectation function.

Usage

# S3 method for CatDP
MPE(obj, ...)

Arguments

obj

A "CatDP" object.

...

Additional arguments to be passed to other inherited types.

Value

numeric.

References

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

See Also

CatDP

Examples

Run this code
# NOT RUN {
x <- sample(1L:10L,size = 40,replace = TRUE)
obj <- CatDP()
posterior(obj = obj,ss = x)
MPE(obj)
# }

Run the code above in your browser using DataLab