Learn R Programming

GaSP (version 1.0.6)

PlotStdResiduals: Plot standardized residuals versus predictions.

Description

Plot standardized residuals versus predictions made by Predict or CrossValidate.

Usage

PlotStdResiduals(
  y_pred,
  y,
  y_name = "y",
  y_units = "",
  title = c("Predict", "CrossValidate"),
  pch = 1
)

Value

No return value, generates plots.

Arguments

y_pred

A data frame of predicted output values made by Predict or CrossValidate.

y

A vector of length equal to the number of rows in y_pred containing the true output values.

y_name

An optional character string containing the output variable name (for labels).

y_units

An optional character string constaining the units of the output variable (for labels).

title

A character string for the name of the function generating the predictions (for an appropriate title): "Predict" from Predict or "CrossValidate" from CrossValidate; "" for no title.

pch

Plotting symbol for plot; default is open circle.

Examples

Run this code
# \dontshow{
x <- borehole$x
y <- borehole$y
theta <- c(
  5.767699e+01, 0.000000e+00, 0.000000e+00, 1.433571e-06,
  0.000000e+00, 2.366557e-06, 1.695619e-07, 2.454376e-09
)
alpha <- c(
  1.110223e-16, 0.000000e+00, 0.000000e+00, 0.000000e+00,
  0.000000e+00, 0.000000e+00, 2.494862e-03, 0.000000e+00
)
cor_par <- data.frame(Theta = theta, Alpha = alpha)
rownames(cor_par) <- colnames(borehole$x)
sp_var <- 38783.7
borehole_fit <- GaSPModel(
  x = borehole$x, y = borehole$y,
  reg_model = ~1, cor_family = "PowerExponential",
  cor_par = cor_par, random_error = FALSE,
  sp_var = sp_var
)
borehole_cv <- CrossValidate(borehole_fit)
# }
PlotStdResiduals(borehole_cv, y, title = "CrossValidate")

Run the code above in your browser using DataLab