% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Base_Fit.R
\name{RTMB_Fit_Base}
\alias{RTMB_Fit_Base}
\title{Base class for RTMB Fit objects}
\description{
Base class for RTMB Fit objects

Base class for RTMB Fit objects
}
\details{
An R6 base class providing common methods for Bayesian and MAP inference results.
}
\section{Public fields}{
\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{model}}{The `RTMB_Model` object used for estimation.}
}
\if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-RTMB_Fit_Base-get_point_estimate}{\code{RTMB_Fit_Base$get_point_estimate()}}
\item \href{#method-RTMB_Fit_Base-estimate}{\code{RTMB_Fit_Base$estimate()}}
\item \href{#method-RTMB_Fit_Base-EAP}{\code{RTMB_Fit_Base$EAP()}}
\item \href{#method-RTMB_Fit_Base-MAP}{\code{RTMB_Fit_Base$MAP()}}
\item \href{#method-RTMB_Fit_Base-rotate}{\code{RTMB_Fit_Base$rotate()}}
\item \href{#method-RTMB_Fit_Base-fa_rotate}{\code{RTMB_Fit_Base$fa_rotate()}}
\item \href{#method-RTMB_Fit_Base-clone}{\code{RTMB_Fit_Base$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-get_point_estimate"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-get_point_estimate}{}}}
\subsection{Method \code{get_point_estimate()}}{
Abstract method to get a point estimate for a target parameter.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$get_point_estimate(target, ...)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{target}}{Character string specifying the target parameter name.}

\item{\code{...}}{Additional arguments.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A numeric array or matrix of the point estimate.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-estimate"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-estimate}{}}}
\subsection{Method \code{estimate()}}{
Get point estimates for parameters, transformed parameters, and generated quantities.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$estimate(
  pars = NULL,
  type = c("mean", "EAP", "marginal_map", "joint_map", "MAP"),
  component = c("all", "parameters", "transform", "generate"),
  chains = NULL,
  best_chains = NULL,
  drop = TRUE,
  ...
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{pars}}{Optional character or numeric vector of parameter names or indices to extract.
Supports special keywords: "parameters", "transform", "generate", and "all".}

\item{\code{type}}{Character string specifying the estimation type.}

\item{\code{component}}{Character string specifying the component to filter by.}

\item{\code{chains}}{Numeric vector of chains to include.}

\item{\code{best_chains}}{Number of best chains to include.}

\item{\code{drop}}{Logical; if TRUE and only one parameter is selected, return the value directly instead of a list.}

\item{\code{...}}{Additional arguments passed to draws().}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A named list of point estimates, or a single value if `drop = TRUE`.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-EAP"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-EAP}{}}}
\subsection{Method \code{EAP()}}{
Calculate Expected A Posteriori (EAP) estimates from posterior samples.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$EAP(
  pars = "parameters",
  chains = NULL,
  best_chains = NULL,
  drop = FALSE,
  ...
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{pars}}{Optional character vector of parameter names to extract.}

\item{\code{chains}}{Numeric vector of chains to include.}

\item{\code{best_chains}}{Number of best chains to include.}

\item{\code{drop}}{Logical; whether to drop the list if only one parameter is selected.}

\item{\code{...}}{Additional arguments passed to `estimate()`.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A named list of EAP estimates.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-MAP"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-MAP}{}}}
\subsection{Method \code{MAP()}}{
Calculate Maximum A Posteriori (MAP) estimates.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$MAP(
  pars = "parameters",
  chains = NULL,
  best_chains = NULL,
  type = c("marginal", "joint"),
  drop = FALSE,
  ...
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{pars}}{Optional character vector of parameter names to extract.}

\item{\code{chains}}{Numeric vector of chains to include.}

\item{\code{best_chains}}{Number of best chains to include.}

\item{\code{type}}{Character string; "marginal" or "joint" MAP.}

\item{\code{drop}}{Logical; whether to drop the list if only one parameter is selected.}

\item{\code{...}}{Additional arguments passed to `estimate()`.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
A named list of MAP estimates.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-rotate"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-rotate}{}}}
\subsection{Method \code{rotate()}}{
Rotate sampled parameters.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$rotate(target, reference = NULL, linked = NULL)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{target}}{Character string specifying the target variable to base the rotation on.}

\item{\code{reference}}{Matrix to rotate towards. If NULL, the target's point estimate is used.}

\item{\code{linked}}{Character vector of variable names to be rotated in the same direction.}

\item{\code{overwrite}}{Logical; whether to overwrite the stored draws. If FALSE, adds to generated quantities. Default is FALSE.}

\item{\code{suffix}}{Character string to append to the rotated variable names when overwrite is FALSE. Default is "rot".}

\item{\code{...}}{Additional arguments passed to the rotation function.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
The updated object invisibly.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-fa_rotate"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-fa_rotate}{}}}
\subsection{Method \code{fa_rotate()}}{
Rotate factor loadings and optional factor scores.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$fa_rotate(
  target = "L",
  linked = NULL,
  scores = NULL,
  rotate = "promax",
  ...
)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{target}}{Character string specifying the target variable to base the rotation on.}

\item{\code{linked}}{Character vector of variable names to be rotated in the same direction.}

\item{\code{scores}}{Character vector of variable names to be rotated as factor scores (inverse direction).}

\item{\code{rotate}}{Character string specifying the rotation method.}

\item{\code{...}}{Additional arguments passed to the rotation function.}
}
\if{html}{\out{</div>}}
}
\subsection{Returns}{
The updated object invisibly.
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-RTMB_Fit_Base-clone"></a>}}
\if{latex}{\out{\hypertarget{method-RTMB_Fit_Base-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RTMB_Fit_Base$clone(deep = FALSE)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}
