Main Content

Create ARIMA Models That Include Exogenous Covariates

These examples show how to create variousARIMAX modelsby using thearimafunction.

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:

( 1 - 0 . 1 L ) ( 1 - L ) 1 y t = x t [ 3 - 2 5 ] + ε t .

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 modelMdlhas the following qualities:

  • PropertyPin the output is the sum of the autoregressive lags and the degree of integration, i.e.,P=p+D=2.

  • Betacontains 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 nonzeroDorSeasonality, then Econometrics Toolbox™ differences the response series y t before the predictors enter the model. Therefore, the predictors enter a stationary model with respect to the response series y t . You should preprocess the predictors x t 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

y t = 6 + 0 . 2 y t - 1 - 0 . 3 y t - 2 + 3 x t + ε t + 0 . 1 ε t - 1

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 modelMdlhasNaN值或一个空单元({}) for theVariance,SAR, andSMAproperties. 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

y t = 6 + 0 . 2 y t - 1 - 0 . 3 y t - 2 + x t [ 3 - 2 ] + ε t + 0 . 1 ε t - 1 ; ε t N ( 0 , 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.

  1. At the command line, open theEconometric Modelerapp.

    econometricModeler

    Alternatively, open the app from the apps gallery (seeEconometric Modeler).

  2. In theTime Seriespane, select the response time series to which the model will be fit.

  3. 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.

    TheTypeModel Parametersdialog box appears. This figure shows theSARIMAX Model Parametersdialog box. All variables in theTime Seriespane, except the chosen response variable, appear in thePredictorssection.

    The SARIMAX Model Parameters dialog box has the

  4. 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.

  5. 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.matdata 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:

    1. In theTime Seriespane, select theUNRATEtime series.

    2. On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.

    3. In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.

    4. In theARIMAX Model Parametersdialog box in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto1.

    5. SetAutoregressive Orderto3.

    6. SetMoving Average Orderto2.

    7. 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:

    1. In theTime Seriespane, select theUNRATEtime series.

    2. On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.

    3. In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.

    4. In theARIMAX Model Parametersdialog box, in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto1.

    5. SetAutoregressive Orderto3.

    6. SetMoving Average Orderto2.

    7. Clear theInclude Constant Termcheck box.

    8. In thePredictorssection, select theInclude?check box for theCOEandCPIAUCSLtime series.

  • To specify an ARMA(8,1,4) model for the unemployment rate containing nonconsecutive lags

    ( 1 ϕ 1 L ϕ 4 L 4 ϕ 8 L 8 ) ( 1 L ) y t = ( 1 + θ 1 L + θ 4 L 4 ) ε t + β 1 C O E t + β 2 C P I A U C S L t ,

    whereεtis a series of IID Gaussian innovations:

    1. In theTime Seriespane, select theUNRATEtime series.

    2. On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.

    3. In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.

    4. In theARIMAX Model Parametersdialog box, click theLag Vectortab.

    5. SetDegree of Integrationto1.

    6. SetAutoregressive Lagsto1 4 8.

    7. SetMoving Average Lagsto1 4.

    8. Clear theInclude Constant Termcheck box.

    9. In thePredictorssection, select theInclude?check box for theCOEandCPIAUCSLtime series.

    The ARIMAX Model Parameters dialog box has the

  • 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:

    1. In theTime Seriespane, select theUNRATEtime series.

    2. On theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.

    3. In the models gallery, in theARMA/ARIMA Modelssection, clickARIMAX.

    4. In theARIMAX Model Parametersdialog box, in theNonseasonalsection of theLag Ordertab, setDegree of Integrationto1.

    5. SetAutoregressive Orderto3.

    6. SetMoving Average Orderto2.

    7. Click theInnovation Distributionbutton, then selectt.

    8. 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

y t = i = 1 p ϕ i y t i + k = 1 r β k x t k + ε t + j = 1 q θ j ε t j , (1)
and it has the following condensed form inlag operator notation:
ϕ ( L ) y t = c + x t β + θ ( L ) ε t . (2)
InEquation 2, the vector x t holds the values of therexogenous, time-varying predictors at timet, with coefficients denotedβ.

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 ϕ ( L ) = L p ϕ 1 L p 1 ϕ 2 L p 2 ... ϕ p L p = 0 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 integrationD. 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,estimateimposes stationarity constraints during estimation.

  • The software differences the response seriesytbeforeincluding the exogenous covariates if you specify the degree of integrationD. In other words, the exogenous covariates enter a model with astationary response. Therefore, the ARIMAX(p,D,q) model is

    ϕ ( L ) y t = c + x t β + θ ( L ) ε t , (3)
    wherec*=c/(1 –L)Dandθ*(L)=θ(L)/(1 –L)D. Subsequently, the interpretation ofβhas changed to the expected effect a unit increase in the predictor has on thedifferencebetween current and lagged values of the response (conditional on those lagged values).

  • You should assess whether the predictor seriesxtare stationary. Difference all predictor series that are not stationary withdiffduring 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

    ϕ ( L ) Φ ( L ) y t = c + x t β + θ ( L ) Θ ( L ) ε t ,

    whereΦ(L)andΘ(L)are the seasonal lag polynomials. Ifytis not stationary, then you can specify degrees of nonseasonal or seasonal integration usingarima. 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