predict_training_data_random_effects.GPModel: Predict ("estimate") training data random effects for a...

predict_training_data_random_effects.GPModelR Documentation

Predict ("estimate") training data random effects for a GPModel

Description

Predict ("estimate") training data random effects for a GPModel

Usage

## S3 method for class 'GPModel'
predict_training_data_random_effects(gp_model,
  predict_var = FALSE, offset = NULL, ...)

## S3 method for class 'gpb.Booster'
predict_training_data_random_effects(gp_model,
  predict_var = FALSE, ...)

Arguments

gp_model

A GPModel or a gpb.Booster with a GPModel

predict_var

A boolean. If TRUE, the (posterior) predictive variances are calculated

offset

A numeric vector with additional fixed effects contributions that are added to the linear predictor (= offset). The length of this vector needs to equal the number of training data points times the number of fixed-effect sets.

...

Additional arguments passed to methods.

Value

A GPModel

Author(s)

Fabio Sigrist

Examples


data(GPBoost_data, package = "gpboost")
# Add intercept column
X1 <- cbind(rep(1,dim(X)[1]),X)
X_test1 <- cbind(rep(1,dim(X_test)[1]),X_test)

gp_model <- fitGPModel(group_data = group_data[,1], y = y, X = X1, likelihood="gaussian")
all_training_data_random_effects <- predict_training_data_random_effects(gp_model)
first_occurences <- match(unique(group_data[,1]), group_data[,1])
unique_training_data_random_effects <- all_training_data_random_effects[first_occurences]
head(unique_training_data_random_effects)


gpboost documentation built on July 13, 2026, 5:07 p.m.