% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ctStanModel.R
\name{ctModelConvertOMX}
\alias{ctModelConvertOMX}
\alias{ctStanModel}
\title{Convert an old OpenMx-style ctsem model to the modern ctsem model format.}
\usage{
ctModelConvertOMX(ctmodelobj, type = "ct", tipredDefault = TRUE)
}
\arguments{
\item{ctmodelobj}{ctsem model object created by \code{\link{ctModel}} with
\code{type='omx'}.}

\item{type}{Either \code{'ct'} for continuous time, or \code{'dt'} for
discrete time.}

\item{tipredDefault}{Logical. TRUE sets any parameters with unspecified time independent 
predictor effects to have effects estimated, FALSE fixes the effect to zero unless individually specified.}
}
\value{
List object of class ctStanModel in the modern ctsem model format,
with a \code{pars} data frame used by \code{\link{ctFit}}. Random effects are
specified for any intercept type parameters (T0MEANS, MANIFESTMEANS, and or
CINT), and time independent predictor effects are specified for all
parameters. Adjust these after initial specification by directly editing the
\code{pars} subobject, so \code{model$pars}, or by editing the pars-backed
matrix view, so \code{model$matrices}.
}
\description{
Convert an old OpenMx-style ctsem model to the modern ctsem model format.
}
\details{
\code{ctModelConvertOMX()} is primarily a compatibility bridge for older
workflows that first build a matrix-list model with \code{ctModel(type='omx')}.
New Stan-based models can usually be created directly with
\code{ctModel(type='ct')} or \code{ctModel(type='dt')}, which already return
the modern format.
}
\examples{
model <- ctModel(type='omx', Tpoints=50,
n.latent=2, n.manifest=1, 
manifestNames='sunspots', 
latentNames=c('ss_level', 'ss_velocity'),
LAMBDA=matrix(c( 1, 'ma1' ), nrow=1, ncol=2),
DRIFT=matrix(c(0, 1,   'a21', 'a22'), nrow=2, ncol=2, byrow=TRUE),
MANIFESTMEANS=matrix(c('m1'), nrow=1, ncol=1),
# MANIFESTVAR=matrix(0, nrow=1, ncol=1),
CINT=matrix(c(0, 0), nrow=2, ncol=1),
DIFFUSION=matrix(c(
  0, 0,
  0, "diffusion"), ncol=2, nrow=2, byrow=TRUE))

modernmodel=ctModelConvertOMX(model)


}
