predict_smooth {mgss}R Documentation

Predictions from model

Description

Makes predictions of new observations from a fitted spline model.

Usage

predict_smooth(model_smooth, X)

Arguments

model_smooth

A spline model resulting from CG_smooth, PCG_smooth, or MGCG_smooth.

X

Matrix containing the new observations.

Value

Vector of length nrow(X) of predictions.

Examples

data <- generate_test_data(100, 2)
X <- data$X_train
y <- data$y_train
result <- PCG_smooth(m = c(7,7), q = c(3,3), lambda = 0.1, X = X, y = y, print_error = FALSE)
X_test <- data$X_test
predict_smooth(model_smooth = result, X = X_test)


[Package mgss version 1.2 Index]