ctFitAutoGroupModel | R Documentation |
Fit a ctStan model with automatic parameter selection for multiple subjects
ctFitAutoGroupModel(
m,
dat,
cores,
DRIFT = TRUE,
DIFFUSION = TRUE,
groupFreeThreshold = 0.5,
...
)
m |
ctStan model object without time independent predictors. |
dat |
Data in long format |
cores |
Number of CPU cores to use |
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 |
groupFreeThreshold |
Numeric, threshold for group free parameter selection. Default is .5 |
... |
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). Subjects are fit one by one, and a group model is determined based on the groupFreeThreshold parameter – when the proportion of subjects with a parameter free is above this threshold, the parameter is freed in the group model.
A list containing a list of ctStan fit objects for each subject, and a group model
## Not run:
testmodel <- ctstantestfit$ctstanmodelbase
testmodel$pars$TI1_effect <- NULL
testmodel$n.TIpred <- 0
testmodel$TIpredNames <- NULL
testfit <- ctFitAutoGroupModel(testmodel,
dat = ctstantestdat, cores=2, DRIFT = TRUE, DIFFUSION = TRUE)
ctModelLatex(testfit$groupModel)
lapply(testfit$fits,function(x) print(ctStanContinuousPars(x)$DRIFT))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.