% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotMCMC.R
\name{plotMCMC}
\alias{plotMCMC}
\title{Trace plot of parameters}
\usage{
plotMCMC(object, estimator = "nu", coeff.idx = 2)
}
\arguments{
\item{object}{returned object from Bayesian MoE or mixture model}

\item{estimator}{specified parameter for traceplot}

\item{coeff.idx}{choice of one covariate to show its coefficients in clusters}
}
\value{
A trace plot
}
\description{
Draw MCMC trace plot of parameters
}
\examples{

# simulate data
set.seed(123)
n <- 500 # subjects
p <- 2
# True gating coefficients (last column zero)
set.seed(123)
Xq <- 3
K <- 3
betas <- matrix(runif(Xq * K, -2, 2), nrow = Xq, ncol = K)
betas[, K] <- 0
dat <- simData(n, p,
  Xq = 3, K = 3, betas = betas,
  pis = c(0.35, 0.40, 0.25),
  nus = c(8, 16, 3)
)

set.seed(123)
fit <- moewishart(
  dat$S,
  X = cbind(1, dat$X), K = 3,
  mh_sigma = c(0.2, 0.1, 0.1), # RW-MH variances (length K)
  mh_beta = c(0.2, 0.2), # RW-MH variances (length K-1)
  niter = 500, burnin = 200
)

plotMCMC(fit, estimator = "nu")

}
