Learn R Programming

ctsem (version 1.1.6)

ctRefineTo: ctRefineTo

Description

Fits a ctsem model in a stepwise fashion to help with difficult optimization.

Usage

ctRefineTo(datawide, ctmodelobj, modfunc = NULL, ...)

Arguments

datawide
Data in ctsem wide format
ctmodelobj
A continuous time model specified via the ctModel function.
modfunc
function to run prior to each optimization step, that takes ctsem fit object, modifies it as desired, and returns the fit object.
...
additional parameters to pass to ctFit.

Value

Returns a fitted ctsem object in the same manner as ctFit.

Details

This function fits a sequence of ctsem models increasing in complexity, starting with a model involving fixed and relatively strong auto effects, no cross effects, no predictors, and no off-diagonal covariances. For many models this can improve the speed and robustness of fitting