Description Usage Arguments Details Value Examples
Performs cross-validation of a Gaussian process panel model.
1 | crossvalidate(gpModel, foldVector)
|
gpModel |
object of class GPPM. |
foldVector |
integer vector. Describes the foldstructure to use. For example, created by |
The fold vector, must be a vector of length nrow(datas(gpModel)) of integers from 1 to k. If foldVector[i]=j
, then data point i is assigned to fold j.
Cross-validation estimates of the mean squared error (MSE) and the negative log-predictive probability (nLPP)
1 2 3 4 5 6 7 | data("demoLGCM")
lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
demoLGCM,'ID','y')
theFolds <- createLeavePersonsOutFolds(lgcm,k=2) #for speed, in practive rather use default k=10
crosRes <- crossvalidate(lgcm,theFolds)
crosRes$MSE #mean squared error
crosRes$nLPP #negative log-predictive probability
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.