April 2019
Intermediate to advanced
426 pages
11h 13m
English
The model_results variable is a SARIMAXResults object of the statsmodel module, representing the output of the SARIMAX model. It contains a get_prediction() method for performing in-sample prediction and out-of-sample forecasting. It also contains a conf_int() method, which returns the confidence intervals of the predictions, both lower- and upper-bounded, of the fitted parameters, which is at a 95% confidence interval by default. Let's apply these methods:
In [ ]: n = len(df_settle.index) prediction = model_results.get_prediction( start=n-12*5, end=n+5 ) prediction_ci = prediction.conf_int()
The start parameter in the get_prediction() method indicates we are performing an in-sample prediction ...