predict_smooth: Predictions from model

Description Usage Arguments Value Examples

View source: R/mgss_main.R

Description

Makes predictions of new observations from a fitted spline model.

Usage

1
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

1
2
3
4
5
6
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)

mgss documentation built on May 10, 2021, 9:07 a.m.