% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-networks.R
\name{fit_higher_order_transition_model}
\alias{fit_higher_order_transition_model}
\title{Fit a higher-order transition model}
\usage{
fit_higher_order_transition_model(
  data,
  sequence_id_col = "sequence_id",
  order_col = "sequence_order",
  state_col = "state",
  order = 2L,
  smoothing = 0.5,
  backoff = TRUE,
  context_separator = " > "
)
}
\arguments{
\item{data}{Long-format sequence data.}

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

\item{order}{Context order.}

\item{smoothing}{Additive smoothing over observed next states.}

\item{backoff}{Retain lower-order context tables for prediction backoff.}

\item{context_separator}{Context separator.}
}
\value{
An object of class \code{gp3_higher_order_transition_model}.
}
\description{
Fit a higher-order transition model
}
\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_higher_order_transition_model(sequences, order = 2L)

}
