valplot | R Documentation |
Plot validation prediction errors
valplot(predmean, predvar, Yval, d = NULL)
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. |
None, makes a plot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.