accuracy: Accuracy Estimates for Predictions

View source: R/predict.R

accuracyR Documentation

Accuracy Estimates for Predictions

Description

Estimate the accuracy based on predictions.

Usage

accuracy(predRes)

Arguments

predRes

object of class GPPMPred as obtained by predict.GPPM

Value

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

Examples


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


gppm documentation built on Aug. 25, 2025, 9:50 a.m.

Related to accuracy in gppm...