Fits a ctsem m in a stepwise fashion to help with difficult optimization.
ctRefineTo(datawide, ctmodelobj, modfunc = NULL, ...)
Data in ctsem wide format
A continuous time m specified via the ctModel
function.
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
.
Returns a fitted ctsem object in the same manner as ctFit
.
This function fits a sequence of ctsem models increasing in complexity, starting with a m 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