multivariate_forecast.Rdmultivariate_forecast Takes data frame or matrix of responses and dataframe of predictors and automates predictions
multivariate_forecast(
response,
predictors,
model_type,
n_forecast = 10,
n_years_ahead = 1,
max_vars = 3,
formula = NULL
)A matrix or data frame of responses for the modeling (values to be forecast) containing a "time" column, "species" column, and "dev" column
A data frame of predictors used for forecasting recruitment
The type of model used to link predictors to forecasted recruitment. Can be "lm", "gam",
How many years to use as a holdout / test set
How many years ahead to forecast (defaults to 1) 1:n_vars variables, and then results are combined and sorted to remove duplicates
The maximum number of variables to include as predictors; defaults to 3
Optional formula for passing to gam(), glmmTMB(), randomForest(), etc.
a list containing predictions and the variables used in making predictions