devStandard: Predictive deviance of a linear model

Description Usage Arguments Details Value Note Author(s) References Examples

Description

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.

Usage

1
devStandard(preds, ytest, RMSE=TRUE)

Arguments

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.

Details

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.

Value

Predictive deviance of the linear model, given predictions of test data (numeric scalar).

Note

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

Author(s)

Thomas Welchowski welchow@imbie.meb.uni-bonn.de

References

Simon N. Wood, (2006), Generalized Additive Models: An Introduction with R, Taylor \& Francis Group LLC

Examples

 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)

kernDeepStackNet documentation built on May 2, 2019, 8:16 a.m.