% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pgmm-main.R
\name{pgmm_rjmcmc}
\alias{pgmm_rjmcmc}
\title{Bayesian Model-Based Clustering with Parsimonious Gaussian Mixture Models}
\usage{
pgmm_rjmcmc(
  X,
  m_init,
  m_range,
  q_new,
  delta = 2,
  ggamma = 2,
  burn = 20,
  niter = 1000,
  constraint = c(0, 0, 0),
  d_vec = c(1, 1, 1),
  s_vec = c(1, 1, 1),
  m_step = 0,
  v_step = 0,
  split_combine = 0,
  verbose = TRUE
)
}
\arguments{
\item{X}{the observation matrix with variables in rows and observations in
columns.}

\item{m_init}{the number of initial clusters.}

\item{m_range}{the allowed range for the number of clusters.}

\item{q_new}{the number of latent factors for a new cluster.}

\item{delta}{scalar hyperparameter for the noise covariance prior}

\item{ggamma}{scalar hyperparameter used in covariance-structure proposals}

\item{burn}{the number of burn-in iterations}

\item{niter}{the number of posterior sampling iterations}

\item{constraint}{initial PGMM covariance constraint. Use a three-letter
model label such as `"CCC"` or `"UUU"`, or a numeric vector of length
three with binary entries. For example, `c(1, 1, 1)` is `CCC`, the fully
constrained model, and `c(0, 0, 0)` is `UUU`, the fully unconstrained
model.}

\item{d_vec}{a vector of hyperparameters with length three, shape parameters
for alpha1, alpha2 and bbeta respectively}

\item{s_vec}{a vector of hyperparameters with length three, rate parameters
for alpha1, alpha2 and bbeta respectively}

\item{m_step}{indicator for RJMCMC model selection on the number of clusters.}

\item{v_step}{indicator for RJMCMC model selection on covariance structures.}

\item{split_combine}{indicator for using split/combine moves in the
cluster-number RJMCMC step.}

\item{verbose}{logical; if `TRUE`, print iteration progress.}
}
\value{
A list of posterior samples with snake_case fields:
  `tau_samples`, `psi_samples`, `mean_samples`, `lambda_samples`,
  `factor_score_samples`, `allocation_samples`, `constraint_samples`,
  `alpha1_samples`, `alpha2_samples`, `beta_samples`, and
  `active_cluster_samples`.
}
\description{
Carries out model-based clustering using parsimonious Gaussian mixture
models. MCMC is used for parameter estimation and RJMCMC is used for model
selection.
}
\details{
The `constraint` argument follows the three-letter PGMM model notation used
in Lu, Li, and Love (2021). The first entry indicates whether loading
matrices are shared across clusters, the second whether noise covariance
matrices are shared across clusters, and the third whether the noise
covariance is isotropic within each cluster. Use [model_to_constraint()] to
convert model names such as `CCC`, `CCU`, `CUC`, `CUU`, `UCC`, `UCU`, `UUC`,
and `UUU` into the numeric vector used internally.
}
