% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extraction.R
\name{extract_transition_matrix}
\alias{extract_transition_matrix}
\title{Extract Transition Matrix from Model}
\usage{
extract_transition_matrix(model, type = c("raw", "scaled"))
}
\arguments{
\item{model}{A TNA model object or a list containing a 'weights' element.}

\item{type}{Character. Type of matrix to return:
\describe{
\item{"raw"}{The raw weight matrix as stored in the model.}
\item{"scaled"}{Row-normalized to ensure rows sum to 1.}
}
Default: "raw".}
}
\value{
A square numeric matrix with row and column names as state names.
}
\description{
Extract the transition probability matrix from a TNA model object.
}
\details{
TNA models store transition weights in different locations depending on the
model type. This function handles the extraction automatically.

For "scaled" type, each row is divided by its sum to create valid transition
probabilities. This is useful when the original weights don't sum to 1.
}
\examples{
seqs <- data.frame(V1 = c("A","B","A"), V2 = c("B","A","C"), V3 = c("A","C","B"))
net <- build_network(seqs, method = "relative")
trans_mat <- extract_transition_matrix(net)
print(trans_mat)

}
\seealso{
\code{\link{extract_initial_probs}} for extracting initial probabilities,
\code{\link{extract_edges}} for extracting an edge list.
}
