Course Content
Introduction to Finance with Python
Introduction to Finance with Python
Autoregressive Model with Integrated Moving Average (ARIMA)
What is ARIMA?
What is integrated differencing?
Here is an example of differencing:
- Original time series definitely has trend, which goes upside rapidly;
- After the first differencing, trend's component is still in time series, but already way weaker;
- After the second difference, time series already has no trend, and looks more like a "white noise";
- After the third differencing, generally nothing changes significantly, except that variance of time series increases.
So we can see, that differencing sometime is very important thing, but also may be quite an excess.
So, unlike AR and ARMA models, ARIMA can be very useful in case, when time series has some non-stationary components(trend, to be more exact).
Defining model
ARIMA model, additionally to parameters of ARMA model, includes also the third parameter d
- which is order of integrated differencing, and, practically, reflects how many times we are going to perform differencing.
We will denote model ARIMA(p, d, q)
.
For example, model ARIMA(2, 1, 3)
is represented by following expression:
Here differenced values of time series computed in the next way:
Also differences can be easily generalized to higher orders ,like here we can see differences of the second and the third orders:
And so on.
Code implementation
To implement and train ARIMA model in Python we can use the following code, which is in fact generalization to the case of ARMA model:
Thanks for your feedback!