Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctLOO

K fold cross validation for ctStanFit objects


Description

K fold cross validation for ctStanFit objects

Usage

ctLOO(
  fit,
  folds = 10,
  cores = 2,
  parallelFolds = FALSE,
  subjectwise = ifelse(length(unique(fit$standata$subject)) > folds, TRUE, FALSE),
  keepfirstobs = FALSE
)

Arguments

fit

ctStanfit object

folds

Number of cross validation splits to use – 10 folds implies that the model is re-fit 10 times, each time to a data set with 1/10 of the observations randomly removed.

cores

Number of processor cores to use.

parallelFolds

compute folds in parallel or use cores to finish single folds faster. parallelFolds will use folds times as much memory.

subjectwise

drop random subjects instead of data rows?

keepfirstobs

do not drop first observation (more stable estimates)

Value

list

Examples

ctLOO(ctstantestfit)

ctsem

Continuous Time Structural Equation Modelling

v3.4.3
GPL-3
Authors
Charles Driver [aut, cre, cph], Manuel Voelkle [aut, cph], Han Oud [aut, cph], Trustees of Columbia University [cph]
Initial release
2021-04-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.