I'm struggling to find mention of the 'u' parameter that is returned by the statsmodels ARIMA.fit method in the following ARMAX model parameter estimation example:
import pandas as pd
from statsmodels.tsa.arima.model import ARIMA
# Sample of the full input-output dataset
id_data = pd.DataFrame({
'u': [0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
'y': [-1.4369, -0.999, -0.0325, 0.8435, 0.4339, -0.2925,
-0.8885, -2.3191, -4.004, -5.4779, -7.053, -7.5489,
-8.779, -8.9262, -8.5207, -8.3915, -8.5699, -8.2192,
-8.284, -7.6011]
})
arma22 = ARIMA(id_data.y, exog=id_data.u, order=(2, 0, 2), trend='n').fit()
print(arma22.params)
print(arma22.summary())
Output:
u -0.564553
ar.L1 1.798081
ar.L2 -0.829465
ma.L1 -0.859744
ma.L2 0.998002
sigma2 0.220407
dtype: float64
SARIMAX Results
==============================================================================
Dep. Variable: y No. Observations: 20
Model: ARIMA(2, 0, 2) Log Likelihood -18.559
Date: Sun, 25 Feb 2024 AIC 49.119
Time: 14:26:11 BIC 55.093
Sample: 0 HQIC 50.285
- 20
Covariance Type: opg
==============================================================================
coef std err z P>|z| [0.025 0.975]
------------------------------------------------------------------------------
u -0.5646 0.303 -1.861 0.063 -1.159 0.030
ar.L1 1.7981 0.158 11.407 0.000 1.489 2.107
ar.L2 -0.8295 0.164 -5.059 0.000 -1.151 -0.508
ma.L1 -0.8597 21.365 -0.040 0.968 -42.735 41.016
ma.L2 0.9980 49.501 0.020 0.984 -96.022 98.018
sigma2 0.2204 10.881 0.020 0.984 -21.106 21.547
===================================================================================
Ljung-Box (L1) (Q): 1.05 Jarque-Bera (JB): 0.81
Prob(Q): 0.31 Prob(JB): 0.67
Heteroskedasticity (H): 0.78 Skew: 0.27
Prob(H) (two-sided): 0.76 Kurtosis: 2.18
===================================================================================
Warnings:
[1] Covariance matrix calculated using the outer product of gradients (complex-step).
I was expecting an ARMAX(2, 2) model to have four parameters (four degrees of freedom). I've turned off the trend (const) parameter so it can't be that.
There is a worked-example of an ARMAX(1, 1) model here but no u parameter appears in the results.
If someone can point me to part of the documentation which mentions what 'u' is I'd be grateful.
I think I figured out the answer to my own question.
If you pass raw data instead of a Pandas series the 'u' parameter turns to 'x1' as in the examples in the documentation.
Output:
So the
'u'in fact comes from the Pandas series name of my exogenous inputs.So I'm guessing
'u'(or'x1') is the beta parameter in this ARMAX model definition, which I found on the FAQ page:If someone can confirm this that would be great. Or point me to the part of the document that explains the parameters of the ARIMA model and the
model.summary()andmodel.paramsoutputs.