There's more...

When working with the statsmodels library, we can also use two different methods for forecasting. The first one is called predict. We need to specify the start and end of the prediction interval. We can use indices (in the case of the out of sample, start needs to be the first value after the last index of the training data), a string ('2019-03-15'), or a datetime type (pd.datetime(1990, 12, 25)). We should also specify typ -in case any differencing was done and we want to receive the forecasts in the original scale, we should use 'levels' as the value (the default is 'linear').

The second method—plot_predict—an extension of the first one. Additional parameters include plot_insample (indicates whether we want to plot the in-sample fit) and dynamic. The second one affects the in-sample prediction (fitted values). If dynamic=False, the in-sample lagged values are used for prediction. Otherwise, the in-sample predictions are used in place of lagged dependent variables.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.255.113