Documentation

Specify Conditional Mean Models

Default ARIMA Model

The default ARIMA(p,D,q) model in Econometrics Toolbox™ is the nonseasonal model of the form

Δ D y t = c + ϕ 1 Δ D y t 1 + + ϕ p Δ D y t p + θ 1 ε t 1 + + θ q ε t q + ε t

You can write this equation in condensed form usinglag operator notation:

ϕ ( L ) ( 1 L ) D y t = c + θ ( L ) ε t

In either equation, the default innovation distribution is Gaussian with mean zero and constant variance.

At the command line, you can specify a model of this form using the shorthand syntaxarima(p,D,q)。For the input argumentsp,D, andq, enter the number of nonseasonal AR terms (p), the order of nonseasonal integration (D), and the number of nonseasonal MA terms (q), respectively.

When you use this shorthand syntax,arimacreates anarimamodel with these default property values.

Property Name Property Data Type
AR Cell vector ofNaNs
Beta Empty vector[]of regression coefficients corresponding to exogenous covariates
Constant NaN
D 程度的季节性integration,D
Distribution "Gaussian"
MA Cell vector ofNaNs
P Number of AR terms plus degree of integration,p+D
Q Number of MA terms,q
SAR Cell vector ofNaNs
SMA Cell vector ofNaNs
Variance NaN

To assign nondefault values to any properties, you can modify the created model object using dot notation.

Notice that the inputsDandqare the valuesarimaassigns to propertiesDandQ。However, the input argumentpis not necessarily the valuearimaassigns to the model propertyPPstores the number of presample observations needed to initialize the AR component of the model. For nonseasonal models, the required number of presample observations isp+D

To illustrate, consider specifying the ARIMA(2,1,1) model

( 1 ϕ 1 L ϕ 2 L 2 ) ( 1 L ) 1 y t = c + ( 1 + θ 1 L ) ε t ,

where the innovation process is Gaussian with (unknown) constant variance.

Mdl = arima(2,1,1)
Mdl = arima with properties: Description: "ARIMA(2,1,1) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 3 D: 1 Q: 1 Constant: NaN AR: {NaN NaN} at lags [1 2] SAR: {} MA: {NaN} at lag [1] SMA: {} Seasonality: 0 Beta: [1×0] Variance: NaN

Notice that the model propertyPdoes not have value 2 (the AR degree). With the integration, a total ofp+D(here, 2 + 1 = 3) presample observations are needed to initialize the AR component of the model.

The created model,Mdl, hasNaNs for all parameters. ANaNvalue signals that a parameter needs to be estimated or otherwise specified by the user. All parameters must be specified to forecast or simulate the model.

To estimate parameters, input the model object (along with data) toestimate。This returns a new fittedarimamodel object. The fitted model object has parameter estimates for each inputNaNvalue.

Callingarimawithout any input arguments returns an ARIMA(0,0,0) model specification with default property values:

DefaultMdl = arima
DefaultMdl = arima with properties: Description: "ARIMA(0,0,0) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 0 D: 0 Q: 0 Constant: NaN AR: {} SAR: {} MA: {} SMA: {} Seasonality: 0 Beta: [1×0] Variance: NaN

Specify Nonseasonal Models Using Name-Value Pairs

The best way to specify models toarimais using name-value pair arguments. You do not need, nor are you able, to specify a value for every model object property.arimaassigns default values to any properties you do not (or cannot) specify.

In condensed, lag operator notation, nonseasonal ARIMA(p,D,q) models are of the form

ϕ ( L ) ( 1 L ) D y t = c + θ ( L ) ε t (1)

You can extend this model to an ARIMAX(p,D,q) model with the linear inclusion of exogenous variables. This model has the form

ϕ ( L ) y t = c + x t β + θ ( L ) ε t , (2)
wherec*=c/(1–L)Dandθ*(L)=θ(L)/(1–L)D

Tip

If you specify a nonzeroD, then Econometrics Toolbox differences the response seriesytbeforethe predictors enter the model. You should preprocess the exogenous covariatesxtby testing for stationarity and differencing if any are unit root nonstationary. If any nonstationary exogenous covariate enters the model, then the false negative rate for significance tests ofβcan increase.

For the distribution of the innovations,εt, there are two choices:

  • Independent and identically distributed (iid) Gaussian or Student’stwith a constant variance, σ ε 2

  • Dependent Gaussian or Student’stwith a conditional variance process, σ t 2 。Specify the conditional variance model using agarch,egarch, orgjrmodel.

Thearimadefault for the innovations is an iid Gaussian process with constant (scalar) variance.

In order to estimate, forecast, or simulate a model, you must specify the parametric form of the model (e.g., which lags correspond to nonzero coefficients, the innovation distribution) and any known parameter values. You can set any unknown parameters equal toNaN, and then input the model toestimate(along with data) to get estimated parameter values.

arima(andestimate) returns a model corresponding to the model specification. You can modify models to change or update the specification. Input models (with noNaNvalues) toforecastorsimulatefor forecasting and simulation, respectively. Here are some example specifications using name-value arguments.

Model Specification
  • y t = c + ϕ 1 y t 1 + ε t

  • ε t = σ ε z t

  • ztGaussian

arima('AR',NaN)orarima(1,0,0)
  • y t = ε t + θ 1 ε t 1 + θ 2 ε t 2

  • ε t = σ ε z t

  • ztStudent’stwith unknown degrees of freedom

arima('Constant',0,'MA',{NaN,NaN},...
'Distribution','t')
  • ( 1 0.8 L ) ( 1 L ) y t = 0.2 + ( 1 + 0.6 L ) ε t

  • ε t = 0.1 z t

  • ztStudent’stwith eight degrees of freedom

arima('Constant',0.2,'AR',0.8,'MA',0.6,'D',1,...
'Variance',0.1^2,'Distribution',struct('Name','t','DoF',8))
  • ( 1 + 0.5 L ) ( 1 L ) 1 Δ y t = x t [ 5 2 ] + ε t

  • ε t ~ N ( 0 , 1 )

arima('Constant',0,'AR',-0.5,'D',1,'Beta',[-5 2])

You can specify the following name-value arguments to create nonseasonalarimamodels.

Name-Value Arguments for Nonseasonal ARIMA Models

Name Corresponding Model Term(s) inEquation 1 When to Specify
AR Nonseasonal AR coefficients, ϕ 1 , , ϕ p

To set equality constraints for the AR coefficients. For example, to specify the AR coefficients in the model

y t = 0.8 y t 1 0.2 y t 2 + ε t ,

specify'AR',{0.8,-0.2}

You only need to specify the nonzero elements ofAR。If the nonzero coefficients are at nonconsecutive lags, specify the corresponding lags usingARLags

Any coefficients you specify must correspond to a stable AR operator polynomial.

ARLags Lags corresponding to nonzero, nonseasonal AR coefficients

ARLagsis not a model property.

Use this argument as a shortcut for specifyingARwhen the nonzero AR coefficients correspond to nonconsecutive lags. For example, to specify nonzero AR coefficients at lags 1 and 12, e.g., y t = ϕ 1 y t 1 + ϕ 12 y t 12 + ε t , specify'ARLags',[1,12]

UseARandARLagstogether to specify known nonzero AR coefficients at nonconsecutive lags. For example, if in the given AR(12) model ϕ 1 = 0.6 and ϕ 12 = 0.3 , specify'AR',{0.6,-0.3},'ARLags',[1,12]

Beta Values of the coefficients of the exogenous covariates

Use this argument to specify the values of the coefficients of the exogenous variables. For example, use'Beta',[0.5 7 -2]to specify β = [ 0.5 7 2 ]

By default,Betais an empty vector.

Constant Constant term,c To set equality constraints forc。对于example, for a model with no constant term, specify'Constant',0
By default,Constanthas valueNaN
D Degree of nonseasonal differencing,D To specify a degree of nonseasonal differencing greater than zero. For example, to specify one degree of differencing, specify'D',1
By default,Dhas value0(meaning no nonseasonal integration).
Distribution Distribution of the innovation process Use this argument to specify a Student’stinnovation distribution. By default, the innovation distribution is Gaussian.
对于example, to specify atdistribution with unknown degrees of freedom, specify'Distribution','t'
To specify atinnovation distribution with known degrees of freedom, assignDistributiona data structure with fieldsNameandDoF。对于example, for atdistribution with nine degrees of freedom, specify'Distribution',struct('Name','t','DoF',9)
MA Nonseasonal MA coefficients, θ 1 , , θ q

To set equality constraints for the MA coefficients. For example, to specify the MA coefficients in the model

y t = ε t + 0.5 ε t 1 + 0.2 ε t 2 ,

specify'MA',{0.5,0.2}

You only need to specify the nonzero elements ofMA。If the nonzero coefficients are at nonconsecutive lags, specify the corresponding lags usingMALags

Any coefficients you specify must correspond to an invertible MA polynomial.

MALags Lags corresponding to nonzero, nonseasonal MA coefficients

MALagsis not a model property.

Use this argument as a shortcut for specifyingMAwhen the nonzero MA coefficients correspond to nonconsecutive lags. For example, to specify nonzero MA coefficients at lags 1 and 4, e.g.,

y t = ε t + θ 1 ε t 1 + θ 4 ε t 4 ,

specify'MALags',[1,4]

UseMAandMALagstogether to specify known nonzero MA coefficients at nonconsecutive lags. For example, if in the given MA(4) model θ 1 = 0.5 and θ 4 = 0.2 , specify'MA',{0.4,0.2},'MALags',[1,4]

Variance
  • Scalar variance of the innovation process, σ ε 2

  • Conditional variance process, σ t 2

  • To set equality constraints for σ ε 2 。对于example, for a model with known variance 0.1, specify'Variance',0.1。By default,Variancehas valueNaN

  • To specify a conditional variance model, σ t 2 。Set'Variance'equal to a conditional variance model object, e.g., agarchmodel object.

Note

You cannot assign values to the propertiesPandQ。For nonseasonal models,

  • arimasetsPequal top+D

  • arimasetsQequal toq

Specify Multiplicative Models Using Name-Value Pairs

For a time series with periodicitys, define the degreepsseasonal AR operator polynomial, Φ ( L ) = ( 1 Φ 1 L p 1 Φ p s L p s ) , and the degreeqsseasonal MA operator polynomial, Θ ( L ) = ( 1 + Θ 1 L q 1 + + Θ q s L q s ) 。Similarly, define the degreepnonseasonal AR operator polynomial, ϕ ( L ) = ( 1 ϕ 1 L ϕ p L p ) , and the degreeqnonseasonal MA operator polynomial,

θ ( L ) = ( 1 + θ 1 L + + θ q L q ) (3)

A multiplicative ARIMA model with degreeDnonseasonal integration and degreesseasonality is given by

ϕ ( L ) Φ ( L ) ( 1 L ) D ( 1 L s ) y t = c + θ ( L ) Θ ( L ) ε t (4)
The innovation series can be an independent or dependent Gaussian or Student’stprocess. Thearimadefault for the innovation distribution is an iid Gaussian process with constant (scalar) variance.

In addition to the arguments for specifying nonseasonal models (described inName-Value Arguments for Nonseasonal ARIMA Models), you can specify these name-value arguments to create a multiplicativearimamodel. You can extend an ARIMAX model similarly to include seasonal effects.

Name-Value Arguments for Seasonal ARIMA Models

Argument Corresponding Model Term(s) inEquation 4 When to Specify
SAR Seasonal AR coefficients, Φ 1 , , Φ p s

To set equality constraints for the seasonal AR coefficients. When specifying AR coefficients, use the sign opposite to what appears inEquation 4(that is, use the sign of the coefficient as it would appear on the right side of the equation).

UseSARLagsto specify the lags of the nonzero seasonal AR coefficients. Specify the lags associated with the seasonal polynomials in the periodicity of the observed data (e.g., 4, 8,... for quarterly data, or 12, 24,... for monthly data), and not as multiples of the seasonality (e.g., 1, 2,...).

对于example, to specify the model

( 1 0.8 L ) ( 1 0.2 L 12 ) y t = ε t ,

specify'AR',0.8,'SAR',0.2,'SARLags',12

Any coefficient values you enter must correspond to a stable seasonal AR polynomial.

SARLags Lags corresponding to nonzero seasonal AR coefficients, in the periodicity of the observed series

SARLagsis not a model property.

Use this argument when specifyingSARto indicate the lags of the nonzero seasonal AR coefficients.

对于example, to specify the model

( 1 ϕ L ) ( 1 Φ 12 L 12 ) y t = ε t ,

specify'ARLags',1,'SARLags',12

SMA Seasonal MA coefficients, Θ 1 , , Θ q s

To set equality constraints for the seasonal MA coefficients.

UseSMALagsto specify the lags of the nonzero seasonal MA coefficients. Specify the lags associated with the seasonal polynomials in the periodicity of the observed data (e.g., 4, 8,... for quarterly data, or 12, 24,... for monthly data), and not as multiples of the seasonality (e.g., 1, 2,...).

对于example, to specify the model

y t = ( 1 + 0.6 L ) ( 1 + 0.2 L 12 ) ε t ,

specify'MA',0.6,'SMA',0.2,'SMALags',12

Any coefficient values you enter must correspond to an invertible seasonal MA polynomial.

SMALags Lags corresponding to the nonzero seasonal MA coefficients, in the periodicity of the observed series

SMALagsis not a model property.

Use this argument when specifyingSMAto indicate the lags of the nonzero seasonal MA coefficients.

对于example, to specify the model

y t = ( 1 + θ 1 L ) ( 1 + Θ 4 L 4 ) ε t ,

specify'MALags',1,'SMALags',4

Seasonality Seasonal periodicity,s To specify the degree of seasonal integrationsin the seasonal differencing polynomialΔs= 1 –Ls。对于example, to specify the periodicity for seasonal integration of monthly data, specify“季节性”12
If you specify nonzeroSeasonality, then the degree of the whole seasonal differencing polynomial is one. By default,Seasonalityhas value0(meaning periodicity and no seasonal integration).

Note

You cannot assign values to the propertiesPandQ。For multiplicative ARIMA models,

  • arimasetsPequal top+D+ps+s

  • arimasetsQequal toq+qs

Specify Conditional Mean Model Using Econometric Modeler App

You can specify the lag structure and innovation distribution of seasonal and nonseasonal conditional mean models using theEconometric Modelerapp. The app treats all coefficients as unknown and estimable, including the degrees of freedom parameter for atinnovation distribution.

At the command line, open theEconometric Modelerapp.

econometricModeler

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

In the app, you can see all supported models by selecting a time series variable for the response in theData Browser。Then, on theEconometric Modelertab, in theModelssection, click the arrow to display the models gallery.

TheARMA/ARIMA Modelssection contains supported conditional mean models.

For conditional mean model estimation, SARIMA and SARIMAX are the most flexible models. You can create any conditional mean model that excludes exogenous predictors by clickingSARIMA, or you can create any conditional mean model that includes at least one exogenous predictor by clickingSARIMAX

After you select a model, the app displays theTypeModel Parametersdialog box, whereTypeis the model type. This figure shows theSARIMAX Model Parametersdialog box.

Adjustable parameters in the dialog box depend onType。In general, adjustable parameters include:

  • A model constant and linear regression coefficients corresponding to predictor variables

  • Time series component parameters, which include seasonal and nonseasonal lags and degrees of integration

  • The innovation distribution

As you adjust parameter values, the equation in theModel Equation部分改变以匹配您的规范。Adjustable parameters correspond to input and name-value pair arguments described in the previous sections and in thearimareference page.

For more details on specifying models using the app, seeFitting Models to DataandSpecifying Lag Operator Polynomials Interactively

See Also

Apps

Objects

Functions

Related Examples

More About