ctFitAuto | R Documentation |
Fit a ctStan model with automatic parameter selection
ctFitAuto(
m,
dat,
DRIFT = TRUE,
DIFFUSION = TRUE,
fast = FALSE,
initialRestrictions = NA,
individuals = FALSE,
groupFreeThreshold = 0.5,
cores = 2,
...
)
m |
ctStan model object without time independent predictors. |
dat |
Data in long format |
DRIFT |
Logical, if TRUE, off diagonal drift parameters in the model are tested for inclusion |
DIFFUSION |
Logical, if TRUE, off diagonal diffusion parameters in the model are tested for inclusion |
fast |
Logical, if TRUE, do not compute uncertainty hessian / samples in individual level models. |
initialRestrictions |
Alternative to the DRIFT / DIFFUSION arguments – specify explicitly which parameters should be fixed initially, vector of integers based on the $setup$matsetup element of the ctStanFit object, which gives the parameter numbers. Primarily for internal use. |
individuals |
Logical, if TRUE, fit individual level models and determine a group model based on the groupFreeThreshold argument. |
groupFreeThreshold |
Numeric, threshold for group model structure – if a parameter improves fit in this proportion of individuals or greater, it is freed for all individuals. |
cores |
Number of CPU cores to use |
... |
Additional arguments passed to ctStanFit |
This function is used to automatically select parameters in a ctStan model. Any specified DRIFT / DIFFUSION matrix off diagonals are only included if they significantly improve the likelihood, based on an estimated likelihood ratio test (relying on the Hessian).
A ctStan fit object
## Not run:
testmodel <- ctstantestfit$ctstanmodelbase
testmodel$pars$TI1_effect <- NULL
testmodel$n.TIpred <- 0
testmodel$TIpredNames <- NULL
testfit <- ctFitAuto(testmodel, dat = ctstantestdat, DRIFT = TRUE, DIFFUSION = TRUE)
summary(testfit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.