# MAP.CatDP: Maximum A Posteriori(MAP) estimate of a "CatDP" object In bbricks: Bayesian Methods and Graphical Model Structures for Statistical Modeling

## Description

Generate the MAP estimate of "pi" in following model structure:

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.
The model structure and prior parameters are stored in a "CatDP" object.
The MAP estimate of pi is pi_MAP = argmax_pi p(pi|alpha,x).

## Usage

 ```1 2``` ```## S3 method for class 'CatDP' MAP(obj, ...) ```

## Arguments

 `obj` A "CatDP" object. `...` Additional arguments to be passed to other inherited types.

numeric.

## References

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

`CatDP`
 ```1 2 3 4``` ```x <- sample(1L:10L,size = 40,replace = TRUE) obj <- CatDP() posterior(obj = obj,ss = x) MAP(obj) ```