# calcEquiDist: Calculates (And Plots) the Stationary Distribution (Steady... In bayesMCClust: Mixtures-of-Experts Markov Chain Clustering and Dirichlet Multinomial Clustering

## Description

Calculates (and plots) the posterior expectations of the cluster-specific stationary distributions (also equilibrium distributions or steady states) of the Markov chains (outcome variable) based on the transition matrices for each cluster/group.

## Usage

 ```1 2 3``` ```calcEquiDist(outList, thin = 1, maxi = 50, M0 = outList\$Mcmc\$M0, grLabels = paste("Group", 1:outList\$Prior\$H), printEquiDist = TRUE, plotEquiDist = TRUE) ```

## Arguments

 `outList` specifies a list containing the outcome (return value) of an MCMC run of `mcClust`, `dmClust`, `mcClustExtended` or `dmClustExtended`. `thin` An integer specifying the thinning parameter (default is 1). `maxi` specifies the number of draws to be actually taken (after thinning) from the MCMC draws beginning from the end of the chain (default is 50). `M0` specifies the number of the first MCMC draw after burn-in (default is `outList\$Mcmc\$M0`). `grLabels` A character vector giving user-specified names for the clusters/groups. `printEquiDist` If `TRUE` (default) a LaTeX-style table containing the stationary distributions is generated. `plotEquiDist` If `TRUE` (default) a barplot of the stationary distributions is drawn.

## Details

The last `maxi` MCMC draws of each `thin`-th draw are taken for calculations.

## Value

A matrix of dimension (K+1) x H containing the stationary distributions (steady states) of the Markov chains (outcome variable) based on the transition matrices in the various clusters/groups. Note, H is the number of clusters/groups and K+1 the number of states of the categorical outcome variable.

## Note

Note, that in contrast to the literature (see References), the numbering (labelling) of the states of the categorical outcome variable (time series) in this package is sometimes 0,...,K (instead of 1,...,K), however, there are K+1 categories (states)!

## Author(s)

Christoph Pamminger <[email protected]>

## References

Sylvia Fruehwirth-Schnatter, Christoph Pamminger, Andrea Weber and Rudolf Winter-Ebmer, (2011), "Labor market entry and earnings dynamics: Bayesian inference using mixtures-of-experts Markov chain clustering". Journal of Applied Econometrics. DOI: 10.1002/jae.1249 http://onlinelibrary.wiley.com/doi/10.1002/jae.1249/abstract

Christoph Pamminger and Sylvia Fruehwirth-Schnatter, (2010), "Model-based Clustering of Categorical Time Series". Bayesian Analysis, Vol. 5, No. 2, pp. 345-368. DOI: 10.1214/10-BA606 http://ba.stat.cmu.edu/journal/2010/vol05/issue02/pamminger.pdf

`mcClust`, `dmClust`, `mcClustExtended`, `dmClustExtended`, `barplot2`
 ```1 2``` ```# please run the examples in mcClust, dmClust, mcClustExtended, # dmClustExtended ```