Learn R Programming

GaSP (version 1.0.6)

Predict: Predict from a GaSPModel object.

Description

Predict from a GaSPModel object.

Usage

Predict(GaSP_model, x_pred, generate_coefficients = c(FALSE, TRUE))

Value

A list with the following elements:

y_pred

A data frame with two columns: the predictions Pred and their standard errors SE.

pred_coeffs

A vector of coefficients for further predictions; NULL if generate_coefficients is FALSE.

Arguments

GaSP_model

Object of class GaSPModel.

x_pred

A data frame containing the values of the input variables at which to predict the output.

generate_coefficients

A boolean indicating whether coefficients for further external predictions are generated.

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_pred <- Predict(
  GaSP_model = borehole_fit,
  x_pred = borehole$x_pred,
  generate_coefficients = TRUE
)

Run the code above in your browser using DataLab