% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-preparation.R
\name{prepare_sem_data}
\alias{prepare_sem_data}
\title{Prepare data for the SEM copula VAR model}
\usage{
prepare_sem_data(
  data,
  indicators,
  J = NULL,
  lambda = NULL,
  sigma_e = NULL,
  margins = "normal",
  skew_direction = NULL,
  time_var = "time",
  prior_mu_sd = 0.25,
  prior_phi_sd = 0.5,
  prior_sigma_sd = 0.5,
  prior_rho_sd = 0.75,
  method = c("indicator", "naive")
)
}
\arguments{
\item{data}{A data frame with time series of indicator variables.}

\item{indicators}{A list of two character vectors, each naming J indicator
columns per latent variable.}

\item{J}{Number of indicators per latent variable.}

\item{lambda}{Numeric vector of length J with fixed factor loadings.}

\item{sigma_e}{Fixed measurement error SD (scalar).}

\item{margins}{Character string specifying the latent innovation margin.
One of \code{"normal"} (default) or \code{"exponential"}.}

\item{skew_direction}{Integer vector of length 2 indicating skew direction
for exponential margins. Required when \code{margins = "exponential"}.}

\item{time_var}{Name of the time column (default: \code{"time"}).}

\item{prior_mu_sd}{Prior SD for intercepts.}

\item{prior_phi_sd}{Prior SD for VAR coefficients.}

\item{prior_sigma_sd}{Prior SD for the lognormal prior on the latent
innovation scale parameter.}

\item{prior_rho_sd}{Prior SD for rho_raw.}

\item{method}{Character string: \code{"indicator"} for the fixed measurement
model or \code{"naive"} for row-mean factor scores.}
}
\value{
A named list suitable as Stan data input.
}
\description{
Transforms a data frame of indicator variables into a list suitable for
the SEM copula Stan model. The measurement model parameters (lambda,
sigma_e) are fixed and passed through to Stan.
}
