One of the variants of ARIMA models is a version using exogeneous data, to which this note is dedicated.
It is not widely known that this version of ARIMA models is strongly dependent on the factor by which we multiply the exogeneous data. Generalizing, we can say that the larger the factor, the smaller the prediction error of the model.
To begin with, let us start with a heuristic proof that the factor determining the ratio between the exogeneous data and the target, can influence the prediction error of the algorithm.
For simplicity, let us omit the part of the time series description which in ARIMA models is responsible for the differentiable part, i.e. we assume that the parameter d=0. In other words, we will use the formulations of the ARMAX model.
Then, a given time series X, in ARMAX, can be expressed generally as: Xt=c+ϵt+ARt+MAt+exogt
where c: constant, ϵt: white noise, ARt: Autoregression part, MAt: Moving average part, exogt: exogeneous variable(s).
Now, let's define the exogeneous part exogt as: exogt=Xtα+γt
where α is some proportionality factor, γt - white nose.
Therefore, introducing eq. 2 to eq. 1 we will get: Xt=c+ϵt+ARt+MAt+Xtα+γt
And after rearranging some terms
Xt(1−α)=c+(ϵt+γt)+ARt+MAt
But the part ARt can be written as ARt=∑piϕiXt−i
and similarly the MAt component
MAt=⟨X⟩+βt+∑qiθiβt−i
with:
βn as a white noise, ⟨X⟩ - the expectation value of the X, θi - parameters of the model.
With the above in mind, the eq 4 becomes : Xt=c+ϵt+γt+α⟨X⟩1−α+∑iˆϕiXt−i+⟨X⟩+ˆβt+∑iθiˆβt−i
where I introduced notation: ˆβt−i=βt−i1−α, ˆϕi=ϕi1−α and
ˆθi=θi1−α.
Using definitiona of the ARt and MAt we can rewrite eq 5 into the final form: Xt=c+ϵt+γt+α⟨X⟩1−α+^ARt+^MAt
where components ^ARt and ^MAt correspond to the definitions ARt and MAt but with ˆϕ,
ˆθ and ˆβ coefficients.
The first component of Equation 6 is the most interesting !.
In the case of ARIMA without exogeneous data, the forecasting error is determined by the ϵ . Now, this error is replaced by the expression ϵt⟶ϵt+γt1−α
This is how we reached our final conclusions:
- use exogenous variables that are highly correlated (α≈1.) or anti-correlated (α≈−1.) with the target is equivalent to a model without exogenous variables (but with changed model parameters).
- the use of exog data, scaled by the ratio exogenousdatatarget
allows for a significant modification of the final prediction error of the model.
The error is now scaled by the factor 11−α. So
- we have the error explosions for |α|≈1,
- for |α|<1: error with exog data > error without exogenous variable,
- for |α|>1: error with exog data < error without exogenous variable.
The next step will be a verification of these hypotheses in practice. A practical example of the implementation of the discussed hypothesis is available in the form of a jupyter-notebook script: https://github.com/Lobodzinski/ARIMA_with_exogenous_data.
Here, we just present the dependence of the MAPE error as a function of the exog data factor (in the log10 scale). As you can see, by using an appropriate value of the factor we are able to reduce the prediction error by almost half ! The error reaches its minimum value at a factor value of 4000000. Then the error increases. The increasing part after the minimum is reached is not directly visible in the theoretical proof. I will try to explain it in the next part of the article.
All other details are available in the code: https://github.com/Lobodzinski/ARIMA_with_exogenous_data.
Thank you for the reading !
No comments:
Post a Comment