Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARIMA models : plot_diagnostics, what's meaning of residuals of our model

I am studying the ARIMA models with the following tutorial: https://www.digitalocean.com/community/tutorials/a-guide-to-time-series-forecasting-with-arima-in-python-3#step-5-—-fitting-an-arima-time-series-model

After I fit the model with Step 5 — Fitting an ARIMA Time Series Model with following code:

mod = sm.tsa.statespace.SARIMAX(y,
                                order=(1, 1, 1),
                                seasonal_order=(1, 1, 1, 12),
                                enforce_stationarity=False,
                                enforce_invertibility=False)

results = mod.fit()

print(results.summary().tables[1])

and plot

results.plot_diagnostics(figsize=(15, 12))
plt.show()

I don't know the meaning: the residuals of our model are uncorrelated and normally distributed with zero-mean. I want to know what's the residual in the model, is the meaning that the residual is the difference between true value and predict value.

Why the author set the enforce_stationarity is False since the ARIMA mode need data stationarity, what's meaning of enforce_stationarity and enforce_invertibility?

 enforce_stationarity=False,
 enforce_invertibility=False

If possible, could you explain in detail. thanks!

like image 457
tktktk0711 Avatar asked May 29 '17 15:05

tktktk0711


People also ask

What is residual in ARIMA model?

Residuals. The “residuals” in a time series model are what is left over after fitting a model. For many (but not all) time series models, the residuals are equal to the difference between the observations and the corresponding fitted values: et=yt−^yt.

Does ARIMA use residual error?

ARIMA models use differencing to convert a non-stationary time series into a stationary one, and then predict future values from historical data. These models use “auto” correlations and moving averages over residual errors in the data to forecast future values.

How do you measure the accuracy of an ARIMA model?

Step 1: From Elasticsearch I collected 1000 observations and exported on Python. Step 2: Plotted the data and checked whether data is stationary or not. Step 3: Used log to convert the data into stationary form. Step 4: Done DF test, ACF and PACF.


1 Answers

Residual indeed is the difference between true and predicted value. If there are correlations between residuals - there is information left in the residuals which should be used in computing forecasts. If the residuals have a mean other than zero, then the forecasts are biased. For instance if we have a constantly growing residual like (... -0.3, -0.2, 0.1, 0, 0.1, 0.2, 0.3, ... and so on, the mean will be 0) it means that our model does not fully depict the process.

Parameters: If you look at the package documentation you will see that these parameters are used to ENFORCE stationarity or invertibility. If the data is stationary and the AR parameters are chosen correctly (since you should have done some previous data preprocessing) why should we do it again? Same stands for invertibility.

like image 91
papadoble151 Avatar answered Oct 16 '22 20:10

papadoble151