Predicts the contribution of an individual component j using a fitted SDAM.
predict_individual_fj(object, j, newdata = NULL)
A vector of predictions for fj evaluated at Xjnew.
set.seed(1)
X <- matrix(rnorm(10 * 5), ncol = 5)
Y <- sin(X[, 1]) - X[, 2] + rnorm(10)
model <- SDAM(x = X, y = Y, Q_type = "trim", trim_quantile = 0.5, nfold = 2, n_K = 1)
#> [1] "Initial cross-validation"
#> [1] "Second stage cross-validation"
predict_individual_fj(model, j = 1)
#> [1] 0 0 0 0 0 0 0 0 0 0