Description Usage Arguments Details Value Note Author(s) References Examples
Calculates the deviance on new data observations. The predictive deviance measures how far the predicted values are apart from the saturated model in the test set.
1 | devStandard(preds, ytest, RMSE=TRUE)
|
preds |
Predictions of the specified model (numeric vector). |
ytest |
Data values of the response in the test data. |
RMSE |
Should the default sum of squares be computed or the RMSE? Default is RMSE. |
In the "Gaussian" case it is defined to be the residual sum of squares. ytest
are the test observations and preds
are the predicted values of the model on the test data.
Predictive deviance of the linear model, given predictions of test data (numeric scalar).
This function is not intended to be called directly by the user. Should only be used by experienced users, who want to customize the model. It is called in the model selection process of the kernel deep stacking network with cross-validation, e.g. lossCvKDSN
. The RMSE is used as default, because kriging models may be more stable with smaller variances of the performance criterion
Thomas Welchowski welchow@imbie.meb.uni-bonn.de
Simon N. Wood, (2006), Generalized Additive Models: An Introduction with R, Taylor \& Francis Group LLC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##################
# Fit Gaussian glm
set.seed(10)
x <- matrix(rnorm(100*20),100,20)
set.seed(100)
y <- rnorm(100)
fit1 <- glm(formula=y ~ ., data=data.frame(x))
preds <- predict(fit1, type="response")
# Performance on training data
all.equal(devStandard(preds=preds, ytest=y, RMSE=FALSE), fit1$deviance)
# Performance on random test data
set.seed(100)
yTest <- simulate(fit1)
devStandard(preds=preds, ytest=yTest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.