MPE.CatDirichlet: MPE of a "CatDirichlet" object

Description Usage Arguments Value References See Also Examples

View source: R/Categorical_Inference.r

Description

Generate the MPE of "pi" in following Categorical-Dirichlet structure:

pi|alpha \sim Dir(alpha)

x|pi \sim Categorical(pi)

Where Dir() is the Dirichlet distribution, Categorical() is the Categorical distribution. See ?dDir and dCategorical for the definitions of these distribution.
The model structure and prior parameters are stored in a "CatDirichlet" object.
MPE is pi_MPE = E(pi|alpha,x), E() is the expectation function.

Usage

1
2
## S3 method for class 'CatDirichlet'
MPE(obj, ...)

Arguments

obj

A "CatDirichlet" object.

...

Additional arguments to be passed to other inherited types.

Value

A numeric vector, the MPE of "pi".

References

Murphy, Kevin P. Machine learning: a probabilistic perspective. MIT press, 2012.

See Also

CatDirichlet

Examples

1
2
3
4
5
obj <- CatDirichlet(gamma=list(alpha=rep(1,26),uniqueLabels = letters))
x <- sample(letters,size = 20,replace = TRUE)
w <- runif(20)
posterior(obj=obj,ss=x,w=w)
MPE(obj)

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