Create ARIMA Models That Include Exogenous Covariates
These examples show how to create variousARIMAX modelsby using thearima
function.
Create ARIMAX Model Using Longhand Syntax
This example shows how to specify an ARIMAX model using longhand syntax.
Specify the ARIMAX(1,1,0) model that includes three predictors:
Mdl = arima('AR',0.1,'D',1,'Beta',[3 -2 5])
Mdl = arima with properties: Description: "ARIMAX(1,1,0) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 2 D: 1 Q: 0 Constant: NaN AR: {0.1} at lag [1] SAR: {} MA: {} SMA: {} Seasonality: 0 Beta: [3 -2 5] Variance: NaN
The output shows that the ARIMAX modelMdl
has the following qualities:
Property
P
in the output is the sum of the autoregressive lags and the degree of integration, i.e.,P
=p
+D
=2
.Beta
contains three coefficients corresponding to the effect that the predictors have on the response.Mdl
不存储预测或响应数据。你specify the required data when you operate onMdl
.The rest of the properties are 0,
NaN
, or empty cells.
Be aware that if you specify nonzeroD
orSeasonality
, then Econometrics Toolbox™ differences the response series
before the predictors enter the model. Therefore, the predictors enter a stationary model with respect to the response series
. You should preprocess the predictors
by testing for stationarity and differencing if any are unit root nonstationary. If any nonstationary predictor enters the model, then the false negative rate for significance tests of
can increase.
Specify ARMAX Model Using Dot Notation
This example shows how to specify a stationary ARMAX model usingarima
.
Specify the ARMAX(2,1) model
by including one stationary exogenous covariate inarima
.
Mdl = arima('AR',[0.2 -0.3],'MA',0.1,'Constant',6,'Beta',3)
Mdl = arima with properties: Description: "ARIMAX(2,0,1) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 2 D: 0 Q: 1 Constant: 6 AR: {0.2 -0.3} at lags [1 2] SAR: {} MA: {0.1} at lag [1] SMA: {} Seasonality: 0 Beta: [3] Variance: NaN
The output shows the modelMdl
hasNaN
值或一个空单元({}
) for theVariance
,SAR
, andSMA
properties. You can modify the model using dot notation at the command line. For example, you can introduce another exogenous, stationary covariate, and specify the variance of the innovations as 0.1
Modify the model by specifying an innovations variance of 0.1 and regression coefficient values.
Mdl.Beta = [3 -2]; Mdl.Variance = 0.1; Mdl
Mdl = arima with properties: Description: "ARIMAX(2,0,1) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 2 D: 0 Q: 1 Constant: 6 AR: {0.2 -0.3} at lags [1 2] SAR: {} MA: {0.1} at lag [1] SMA: {} Seasonality: 0 Beta: [3 -2] Variance: 0.1
Specify ARIMAX or SARIMAX Model Using Econometric Modeler App
In theEconometric Modelerapp, you can specify the seasonal and nonseasonal lag structure, presence of a constant, innovation distribution, and predictor variables of an ARIMA(p,D,q) or a SARIMA(p,D,q)×(ps,Ds,qs)smodel by following these steps. All specified coefficients are unknown but estimable parameters.
At the command line, open theEconometric Modelerapp.
econometricModeler
Alternatively, open the app from the apps gallery (seeEconometric Modeler).
In theTime Seriespane, select the response time series to which the model will be fit.
On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery. For strictly nonseasonal models, clickARIMAX; for seasonal models, clickSARIMAX. ARIMAX and SARIMAX models must contain at least one predictor variable.
The
Type
Model Parametersdialog box appears. This figure shows theSARIMAX Model Parametersdialog box. All variables in theTime Seriespane, except the chosen response variable, appear in thePredictorssection.Specify the lag structure. Use theLag Ordertab to specify a model that includes:
All consecutive lags from 1 through their respective orders, in the seasonal polynomials
Lags that are all consecutive multiples of the period (s), in the seasonal polynomials
Ans-degree seasonal integration polynomial
For the flexibility to specify the inclusion of particular lags, use theLag Vectortab. For more details, seeSpecifying Univariate Lag Operator Polynomials Interactively. Regardless of the tab you use, you can verify the model form by inspecting the equation in theModel Equationsection.
In thePredictorssection, choose at least one predictor variable by selecting theInclude?check box for the time series.
For example, suppose you are working with theData_USEconModel.mat
data set and its variables are listed in theTime Seriespane.
指定一个ARIMAX(3, 1, 2)解雇的榜样ment rate containing a constant, all consecutive AR and MA lags from 1 through their respective orders, Gaussian-distributed innovations, and the predictor variablesCOE,CPIAUCSL,FEDFUNDS, andGDP:
In theTime Seriespane, select the
UNRATE
time series.On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.
In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.
In theARIMAX Model Parametersdialog box in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto
1
.SetAutoregressive Orderto
3
.SetMoving Average Orderto
2
.In thePredictorssection, select theInclude?check box for theCOE,CPIAUCSL,FEDFUNDS, andGDPtime series.
指定一个ARIMAX(3, 1, 2)解雇的榜样ment rate containing all AR and MA lags from 1 through their respective orders, Gaussian-distributed innovations, no constant, and the predictor variablesCOEandCPIAUCSL:
In theTime Seriespane, select the
UNRATE
time series.On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.
In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.
In theARIMAX Model Parametersdialog box, in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto
1
.SetAutoregressive Orderto
3
.SetMoving Average Orderto
2
.Clear theInclude Constant Termcheck box.
In thePredictorssection, select theInclude?check box for theCOEandCPIAUCSLtime series.
To specify an ARMA(8,1,4) model for the unemployment rate containing nonconsecutive lags
whereεtis a series of IID Gaussian innovations:
In theTime Seriespane, select the
UNRATE
time series.On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.
In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.
In theARIMAX Model Parametersdialog box, click theLag Vectortab.
SetDegree of Integrationto
1
.SetAutoregressive Lagsto
1 4 8
.SetMoving Average Lagsto
1 4
.Clear theInclude Constant Termcheck box.
In thePredictorssection, select theInclude?check box for theCOEandCPIAUCSLtime series.
To specify an ARIMA(3,1,2) model for the unemployment rate containing all consecutive AR and MA lags through their respective orders, a constant term, the predictor variablesCOEandCPIAUCSL, andt-distributed innovations:
In theTime Seriespane, select the
UNRATE
time series.On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.
In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.
In theARIMAX Model Parametersdialog box, in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto
1
.SetAutoregressive Orderto
3
.SetMoving Average Orderto
2
.Click theInnovation Distributionbutton, then select
t
.In thePredictorssection, select theInclude?check box forCOEandCPIAUCSLtime series.
The degrees of freedom parameter of thetdistribution is an unknown but estimable parameter.
After you specify a model, clickEstimateto estimate all unknown parameters in the model.
What Are ARIMA Models That Include Exogenous Covariates?
ARIMAX(p,D,q) Model
The autoregressive moving average model including exogenous covariates, ARMAX(p,q), extends theARMA(p,q)model by including the linear effect that one or more exogenous series has on thestationaryresponse seriesyt. The general form of the ARMAX(p,q) model is
(1) |
(2) |
You can use this model to check if a set of exogenous variables has an effect on a linear time series. For example, suppose you want to measure how the previous week’s average price of oil,xt, affects this week’s United States exchange rateyt. The exchange rate and the price of oil are time series, so an ARMAX model can be appropriate to study their relationships.
Conventions and Extensions of the ARIMAX Model
ARMAX models have the same stationarity requirements asARMA models. Specifically, the response series isstableif the roots of the homogeneouscharacteristic equationof lie outside of the unit circle according to Wold’s Decomposition[2].
If the response seriesytis not stable, then you can difference it to form a stationaryARIMA model. Do this by specifying the degrees of integration
D
. Econometrics Toolbox™ enforces stability of the AR polynomial. When you specify an AR model usingarima
, the software displays an error if you enter coefficients that do not correspond to a stable polynomial. Similarly,estimate
imposes stationarity constraints during estimation.The software differences the response seriesytbeforeincluding the exogenous covariates if you specify the degree of integration
D
. In other words, the exogenous covariates enter a model with astationary response. Therefore, the ARIMAX(p,D,q) model is(3) You should assess whether the predictor seriesxtare stationary. Difference all predictor series that are not stationary with
diff
during the data preprocessing stage. Ifxtis nonstationary, then a test for the significance ofβcan produce a false negative. The practical interpretation ofβchanges if you difference the predictor series.The software usesmaximum likelihood estimation for conditional mean modelssuch as ARIMAX models. You can specify either a Gaussian or Student’stfor the distribution of the innovations.
You can include seasonal components in an ARIMAX model (seeWhat Are Multiplicative ARIMA Models?) which creates a SARIMAX(p,D,q)(ps,Ds,qs)smodel. Assuming that the response seriesytis stationary, the model has the form
whereΦ(L)andΘ(L)are the seasonal lag polynomials. Ifytis not stationary, then you can specify degrees of nonseasonal or seasonal integration using
arima
. If you specifySeasonality
≥ 0, then the software applies degree one seasonal differencing (Ds= 1) to the response. Otherwise,Ds= 0. The software includes the exogenous covariates after it differences the response.The software treats the exogenous covariates as fixed during estimation and inference.
References
[1]Box, George E. P., Gwilym M. Jenkins, and Gregory C. Reinsel.Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.
[2]Wold, Herman. "A Study in the Analysis of Stationary Time Series."Journal of the Institute of Actuaries70 (March 1939): 113–115.https://doi.org/10.1017/S0020268100011574.
See Also
Apps
Objects
Functions
Related Topics
- Estimate ARIMAX Model Using Econometric Modeler App
- Analyze Time Series Data Using Econometric Modeler
- Specifying Univariate Lag Operator Polynomials Interactively
- Forecast IGD Rate from ARX Model
- Modify Properties of Conditional Mean Model Objects
- Specify ARMAX Model Using Dot Notation
- Create ARIMAX Model Using Longhand Syntax