Learn R Programming

gppm (version 0.3.0)

accuracy: Accuracy Estimates for Predictions

Description

Estimate the accuracy based on predictions.

Usage

accuracy(predRes)

Value

accuracy estimates in the form of the mean squared error (MSE), the negative log-predictive probability (nLPP), and the sum squared error (SSE)

Arguments

predRes

object of class GPPMPred as obtained by predict.GPPM

Examples

Run this code
# \donttest{
data("demoLGCM")
# remove all measurements from person 1 and the first form person 2
predIdx <- c(which(demoLGCM$ID == 1), which(demoLGCM$ID == 2)[1])
fitDemoLGCM <- demoLGCM[setdiff(1:nrow(demoLGCM), predIdx), ]

lgcm <- gppm(
  "muI+muS*t", "varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma",
  fitDemoLGCM, "ID", "y"
)
lgcm <- fit(lgcm)
predRes <- predict(lgcm, demoLGCM[predIdx, ])
accEsts <- accuracy(predRes)
accEsts$MSE # mean squared error
accEsts$nLPP # negative log-predictive probability
accEsts$MAE # mean absolute error
# }

Run the code above in your browser using DataLab