accuracy | R Documentation |
Estimate the accuracy based on predictions.
accuracy(predRes)
predRes |
object of class |
accuracy estimates in the form of the mean squared error (MSE), the negative log-predictive probability (nLPP), and the sum squared error (SSE)
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.