% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-multichannel-hmm.R
\name{fit_multichannel_sequence_hmm}
\alias{fit_multichannel_sequence_hmm}
\title{Fit a multichannel categorical hidden Markov model}
\usage{
fit_multichannel_sequence_hmm(
  data,
  n_states,
  channel_cols,
  sequence_id_col = "sequence_id",
  order_col = "sequence_order",
  symbol_levels = NULL,
  state_names = NULL,
  initial_probs = NULL,
  transition_probs = NULL,
  emission_probs = NULL,
  max_iter = 200L,
  tolerance = 1e-06,
  pseudocount = 1e-06,
  seed = 1L,
  keep_posteriors = FALSE
)
}
\arguments{
\item{data}{Long-format multichannel sequence data.}

\item{n_states}{Number of latent states.}

\item{channel_cols}{Names of categorical observation channels.}

\item{sequence_id_col, order_col}{Core sequence columns.}

\item{symbol_levels}{Optional named list of symbol orders by channel.}

\item{state_names}{Optional latent-state names.}

\item{initial_probs, transition_probs, emission_probs}{Optional starting values.}

\item{max_iter}{Maximum EM iterations.}

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

\item{pseudocount}{Non-negative smoothing count.}

\item{seed}{Reproducibility seed.}

\item{keep_posteriors}{Retain final forward-backward results.}
}
\value{
An object of class \code{gp3_multichannel_sequence_hmm}.
}
\description{
Fits a finite-state, time-homogeneous HMM to two or more categorical
channels under conditional independence of channels given the latent state.
Latent states are statistical model states only.
}
\examples{
multichannel <- data.frame(
  sequence_id = rep(paste0("s", 1:4), each = 5L),
  sequence_order = rep(1:5, times = 4L),
  action = c("A", "B", "C", "C", "D", "A", "B", "B", "C", "D",
             "D", "C", "B", "A", "A", "D", "C", "C", "B", "A"),
  context = rep(c("x", "x", "y", "y", "z"), times = 4L)
)
fit_multichannel_sequence_hmm(multichannel, 2L,
                              channel_cols = c("action", "context"),
                              max_iter = 5L, seed = 1L)
}
