% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pgmm-chains.R
\name{pgmm_rjmcmc_chains}
\alias{pgmm_rjmcmc_chains}
\title{Run Multiple Independent Bayesian PGMM Chains}
\usage{
pgmm_rjmcmc_chains(
  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 = FALSE,
  chains = 2,
  cores = min(chains, available_cores()),
  seed = NULL
)
}
\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.}

\item{chains}{positive integer giving the number of independent chains.}

\item{cores}{positive integer giving the number of worker processes to use.
Values greater than `chains` are reduced to `chains`.}

\item{seed}{optional integer seed used to generate deterministic per-chain
seeds.}
}
\value{
A list with one fitted `pgmm_rjmcmc()` result per chain. The result
  has class `bpgmm_rjmcmc_chains` and stores the per-chain seeds in the
  `chain_seeds` attribute.
}
\description{
Runs independent `pgmm_rjmcmc()` chains, optionally in parallel. This is the
safest way to use multiple CPU cores because each MCMC iteration depends on
the previous state, while independent chains can be evaluated concurrently.
}
