# \donttest{
if (requireNamespace("pls", quietly = TRUE)) {
set.seed(123)
n <- 50
p <- 10
X <- matrix(rnorm(n * p), n, p)
colnames(X) <- paste0("X", 1:p)
Y <- X[, 1:3] %*% diag(c(1, 0.5, 0.3)) + matrix(rnorm(n * 3, 0, 0.5), n, 3)
colnames(Y) <- paste0("Y", 1:3)
result <- fit_pls_multivariate(X, Y, max_components = 5)
preds <- predict_pls(result)
dim(preds)
}
# }
Run the code above in your browser using DataLab