Functions to perform SARIMAX time series modeling in Python.
The functions consist of the following functions:
- adf: testing for Augmented Dickey-Fuller testing for stationarity
- durbin_watson_stat: create the Durbin-Watson statistic to evaluate the fit of the model to the series and check the amount of autocorrelation to be removed
- get_dw: returns the Durbin-Watson statistic
- build_model: builds the SARIMAX model and outputs the summary
- backtest_model: rerun the model in backtest mode to create values to check goodness of fit
- make_predictions: make preditions from the model
- plot_fit: plot the backtest model against the actual series
- prediction_plot: plot the predictions against the test series
- compare_results: make a data frame to compare the predictions to the testing data
- error_calcs: calculate the actual error difference and the percent difference at each prediction interval
- calculate_total_error: get the overall RMSE
- get_conf_interval: get confidence intervals around the predictions
- get_oos_conf_interval: creates a confidence interval for out of series(OOS) forecasting, no comparison for testing
- make_oos_plot_df: creates a specific dataframe to handle OOS forecasts for future plotting
- plot_oos: make a plot of the OOS series, forecasts, confidence intervals
- create_final_oos_df: creates a final date frame of the OOS data and confidence intervals and places a date forecast stamp so this can be used later or loaded into a data warehouse