valplot: Plot validation prediction errors

Description Usage Arguments Value Examples

Description

Plot validation prediction errors

Usage

1
valplot(predmean, predvar, Yval, d = NULL)

Arguments

predmean

Predicted mean

predvar

Predicted variance

Yval

Y validation data

d

If output is multivariate, which column to use. Will do all if left as NULL.

Value

None, makes a plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- matrix(runif(100*3), ncol=3)
f1 <- function(x){x[1]+x[2]^2}
y <- apply(x, 1, f1)
# Create a linear model on the data
mod <- lm(y ~ ., data.frame(x))
# Predict at validation data
Xval <- matrix(runif(3*100), ncol=3)
mod.pred <- predict.lm(mod, data.frame(Xval), se.fit=TRUE)
# Compare to true results
Yval <- apply(Xval, 1, f1)
valplot(mod.pred$fit, mod.pred$se.fit^2, Yval=Yval)

CGGP documentation built on May 8, 2021, 5:06 p.m.