% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-latent-models.R
\name{fit_sequence_hmm_mixture}
\alias{fit_sequence_hmm_mixture}
\title{Fit a mixture of categorical hidden Markov models}
\usage{
fit_sequence_hmm_mixture(
  data,
  n_components,
  n_states,
  sequence_id_col = "sequence_id",
  order_col = "sequence_order",
  state_col = "state",
  symbol_levels = NULL,
  max_iter = 200L,
  inner_initial_iter = 20L,
  tolerance = 1e-06,
  pseudocount = 1e-06,
  seed = 1L
)
}
\arguments{
\item{data}{Long-format sequence data.}

\item{n_components}{Number of mixture components.}

\item{n_states}{Number of hidden states per component; scalar or vector.}

\item{sequence_id_col, order_col, state_col}{Sequence columns.}

\item{symbol_levels}{Optional symbol ordering.}

\item{max_iter}{Maximum mixture-EM iterations.}

\item{inner_initial_iter}{Initial single-HMM iterations per component.}

\item{tolerance}{Relative log-likelihood tolerance.}

\item{pseudocount}{Smoothing count.}

\item{seed}{Reproducibility seed.}
}
\value{
An object of class \code{gp3_sequence_hmm_mixture}.
}
\description{
Fits sequence-level mixture components, each containing a categorical HMM.
Component membership is a statistical clustering device and should not be
interpreted as a substantive latent type without external validation.
}
\examples{
sequences <- data.frame(
  sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
  sequence_order = rep(1:4, times = 4L),
  state = c("A", "B", "C", "D", "A", "B", "C", "C",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L),
  stringsAsFactors = FALSE
)
fit_sequence_hmm_mixture(sequences, n_components = 2L, n_states = 2L,
                         max_iter = 5L, inner_initial_iter = 2L, seed = 1L)

}
