Skip to contents

This function fits an ARIMAX model iteratively. It starts with all of the e exogeneous variables and if an error is thrown, it removes the last one in the list and tries to refit. It repeats this process until a model is successfully fit. If no models fit, an ARIMA model (without exogenous variables) is returned. The model is fit via forecast::auto.arima()

Usage

retry_arima(train_df, pred_vars, this_y_ts)

Arguments

train_df

data.frame of data used to train the model

pred_vars

vector of character names of exogeneous variables

this_y_ts

time series object of observed y variables from train_df. Created via stats::ts().

Value

a fit ARIMAX or ARIMA model, fit via. auto.arima.