Learn R Programming

gpboost (version 0.7.9)

set_prediction_data.GPModel: Set prediction data for a GPModel

Description

Set the data required for making predictions with a GPModel

Usage

# S3 method for GPModel
set_prediction_data(gp_model, group_data_pred = NULL,
  group_rand_coef_data_pred = NULL, gp_coords_pred = NULL,
  gp_rand_coef_data_pred = NULL, cluster_ids_pred = NULL, X_pred = NULL,
  vecchia_pred_type = NULL, num_neighbors_pred = NULL,
  cg_delta_conv_pred = NULL)

Value

A GPModel

Arguments

gp_model

A GPModel

group_data_pred

A vector or matrix with elements being group levels for which predictions are made (if there are grouped random effects in the GPModel)

group_rand_coef_data_pred

A vector or matrix with covariate data for grouped random coefficients (if there are some in the GPModel)

gp_coords_pred

A matrix with prediction coordinates (=features) for Gaussian process (if there is a GP in the GPModel)

gp_rand_coef_data_pred

A vector or matrix with covariate data for Gaussian process random coefficients (if there are some in the GPModel)

cluster_ids_pred

A vector with elements indicating the realizations of random effects / Gaussian processes for which predictions are made (set to NULL if you have not specified this when creating the GPModel)

X_pred

A matrix with prediction covariate data for the fixed effects linear regression term (if there is one in the GPModel)

vecchia_pred_type

A string specifying the type of Vecchia approximation used for making predictions. "order_obs_first_cond_obs_only" = observed data is ordered first and the neighbors are only observed points, "order_obs_first_cond_all" = observed data is ordered first and the neighbors are selected among all points (observed + predicted), "order_pred_first" = predicted data is ordered first for making predictions, "latent_order_obs_first_cond_obs_only" = Vecchia approximation for the latent process and observed data is ordered first and neighbors are only observed points, "latent_order_obs_first_cond_all" = Vecchia approximation for the latent process and observed data is ordered first and neighbors are selected among all points

num_neighbors_pred

an integer specifying the number of neighbors for the Vecchia approximation for making predictions

cg_delta_conv_pred

a numeric specifying the olerance level for L2 norm of residuals for checking convergence in conjugate gradient algorithm when being used for prediction

Author

Fabio Sigrist

Examples

Run this code
# \donttest{
data(GPBoost_data, package = "gpboost")
set.seed(1)
train_ind <- sample.int(length(y),size=250)
gp_model <- GPModel(group_data = group_data[train_ind,1], likelihood="gaussian")
set_prediction_data(gp_model, group_data_pred = group_data[-train_ind,1])
# }

Run the code above in your browser using DataLab