% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/define_dynamic_measurement.R
\name{build_dynamic_previous_stage}
\alias{build_dynamic_previous_stage}
\title{Build a Stage 2 previous_stage object from a dynamic measurement fit}
\usage{
build_dynamic_previous_stage(dyn, stage1_result, data, anchor_period = 1L)
}
\arguments{
\item{dyn}{A \code{dynamic_measurement} object from
\code{\link{define_dynamic_measurement}}.}

\item{stage1_result}{The result object from
\code{estimate_model_rcpp(dyn$model_system, ...)}.}

\item{data}{The same data frame passed to
\code{\link{define_dynamic_measurement}} (needed to rebuild the
dummy model system's components — components don't retain the
data they were defined on).}

\item{anchor_period}{Integer index into \code{dyn$period_prefixes}
giving the period whose measurement intercepts should be carried
into Stage 2. The recommended choice is 1: under
\code{E[f_1] = 0} this period's intercepts identify the true DGP
intercepts. Default: 1.}
}
\value{
A list suitable as \code{previous_stage} in
\code{\link{define_model_system}}: has fields \code{model_system},
\code{estimates}, \code{std_errors}, \code{convergence},
\code{loglik}. Every per-component measurement parameter is the
corresponding Stage 1 estimate, with the intercepts overwritten to
the anchor-period values for all periods.
}
\description{
Constructs a dummy \code{previous_stage} result that plugs the
anchor-period measurement intercepts into every factor slot, pairs
them with the (tied) shared loadings and residual sigmas / thresholds,
and is ready to pass as \code{previous_stage} to a Stage 2
\code{SE_linear} or \code{SE_quadratic} model via
\code{\link{define_model_system}}.
}
\seealso{
\code{\link{define_dynamic_measurement}}.
}
