R2test | R Documentation |
Returns determination coefficient for external test set or cross-validation.
R2test(ts.pred, ts.obs, ws.obs.mean = mean(ts.obs))
ts.pred |
predicted values for external test set or cross-validation folds. |
ts.obs |
observed values for external test set or cross-validation folds. |
ws.obs.mean |
mean value for training set. If determination coefficient for cross-validation folds is calculated, then this parameter can be left as is. |
value of determination coefficient calculated according to formula 1-PRESS/SS.
set.seed(42)
cv.obs <- runif(50, 0, 10)
cv.pred <- cv.obs + rnorm(50)
R2test(cv.pred, cv.obs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.