## Create Regression Models with ARIMA Errors

### Default Regression Model with ARIMA Errors Specifications

Regression models with ARIMA errors have the following form (in lag operator notation):

`$\begin{array}{c}{y}_{t}=c+{X}_{t}\beta +{u}_{t}\\ a\left(L\right)A\left(L\right){\left(1-L\right)}^{D}\left(1-{L}^{s}\right){u}_{t}=b\left(L\right)B\left(L\right){\epsilon }_{t},\end{array}$`

where

• t = 1,...,T.

• yt is the response series.

• Xt is row t of X, which is the matrix of concatenated predictor data vectors. That is, Xt is observation t of each predictor series.

• c is the regression model intercept.

• β is the regression coefficient.

• ut is the disturbance series.

• εt is the innovations series.

• ${L}^{j}{y}_{t}={y}_{t-j}.$

• $a\left(L\right)=\left(1-{a}_{1}L-...-{a}_{p}{L}^{p}\right),$ which is the degree p, nonseasonal autoregressive polynomial.

• $A\left(L\right)=\left(1-{A}_{1}L-...-{A}_{{p}_{s}}{L}^{{p}_{s}}\right),$ which is the degree ps, seasonal autoregressive polynomial.

• ${\left(1-L\right)}^{D},$ which is the degree D, nonseasonal integration polynomial.

• $\left(1-{L}^{s}\right),$ which is the degree s, seasonal integration polynomial.

• $b\left(L\right)=\left(1+{b}_{1}L+...+{b}_{q}{L}^{q}\right),$ which is the degree q, nonseasonal moving average polynomial.

• $B\left(L\right)=\left(1+{B}_{1}L+...+{B}_{{q}_{s}}{L}^{{q}_{s}}\right),$ which is the degree qs, seasonal moving average polynomial.

For simplicity, use the shorthand notation `Mdl = regARIMA(p,D,q)` to specify a regression model with ARIMA(p,D,q) errors, where `p`, `D`, and `q` are nonnegative integers. `Mdl` has the following default properties.

Property NameProperty Data Type
`AR`Length `p` cell vector of `NaN`s
`Beta`Empty vector `[]` of regression coefficients, corresponding to the predictor series
`D`Nonnegative scalar, corresponding to D
`Distribution``"Gaussian"`, corresponding to the distribution of εt
`Intercept``NaN`, corresponding to c
`MA`Length `q` cell vector of `NaN`s
`P`Number of AR terms plus degree of integration, p + D
`Q`Number of MA terms, q
`SAR`Empty cell vector
`SMA`Empty cell vector
`Variance``NaN`, corresponding to the variance of εt
`Seasonality``0`, corresponding to s

If you specify nonseasonal ARIMA errors, then

• The properties `D` and `Q` are the inputs `D` and `q`, respectively.

• Property `P` = `p` + `D`, which is the degree of the compound, nonseasonal autoregressive polynomial. In other words, `P` is the degree of the product of the nonseasonal autoregressive polynomial, a(L) and the nonseasonal integration polynomial, (1 – L)D.

The values of properties `P` and `Q` indicate how many presample observations the software requires to initialize the time series.

You can modify the properties of `Mdl` using dot notation. For example, `Mdl.Variance = 0.5` sets the innovation variance to 0.5.

For maximum flexibility in specifying a regression model with ARIMA errors, use name-value pair arguments to, for example, set each of the autoregressive parameters to a value, or specify multiplicative seasonal terms. For example, `Mdl = regARIMA('AR',{0.2 0.1})` defines a regression model with AR(2) errors, and the coefficients are a1 = 0.2 and a2 = 0.1.

### Specify regARIMA Models Using Name-Value Pair Arguments

You can only specify the nonseasonal autoregressive and moving average polynomial degrees, and nonseasonal integration degree using the shorthand notation `regARIMA(p,D,q)`. Some tasks, such as forecasting and simulation, require you to specify values for parameters. You cannot specify parameter values using shorthand notation. For maximum flexibility, use name-value pair arguments to specify regression models with ARIMA errors.

The nonseasonal ARIMA error model might contain the following polynomials:

• The degree p autoregressive polynomial a(L) = 1 – a1La2L2 –...– apLp. The eigenvalues of a(L) must lie within the unit circle (i.e., a(L) must be a stable polynomial).

• The degree q moving average polynomial b(L) = 1 + b1L + b2L2 +...+ bqLq. The eigenvalues of b(L) must lie within the unit circle (i.e., b(L) must be an invertible polynomial).

• The degree D nonseasonal integration polynomial is (1 – L)D.

The following table contains the name-value pair arguments that you use to specify the ARIMA error model (i.e., a regression model with ARIMA errors, but without a regression component and intercept):

 $\begin{array}{c}{y}_{t}={u}_{t}\\ a\left(L\right){\left(}^{1}=b\left(L\right){\epsilon }_{t}.\end{array}$ (1)

Name-Value Pair Arguments for Nonseasonal ARIMA Error Models

NameCorresponding Model Term(s) in Equation 1When to Specify
`AR`Nonseasonal AR coefficients: a1, a2,...,ap
• To set equality constraints for the AR coefficients. For example, to specify the AR coefficients in the ARIMA error model
${u}_{t}=0.8{u}_{t-1}-0.2{u}_{t-2}+{\epsilon }_{t},$
specify `'AR',{0.8,-0.2}`.

• You only need to specify the nonzero elements of `AR`. If the nonzero coefficients are at nonconsecutive lags, specify the corresponding lags using `ARLags`.

• The coefficients must correspond to a stable AR polynomial.

`ARLags`Lags corresponding to nonzero, nonseasonal AR coefficients
• `ARLags` is not a model property.
Use this argument as a shortcut for specifying `AR` when the nonzero AR coefficients correspond to nonconsecutive lags. For example, to specify nonzero AR coefficients at lags 1 and 12, e.g.,
${u}_{t}={a}_{1}{u}_{t-1}+{a}_{2}{u}_{t-12}+{\epsilon }_{t},$
specify `'ARLags',[1,12]`.

• Use `AR` and `ARLags` together to specify known nonzero AR coefficients at nonconsecutive lags. For example, if in the given AR(12) error model with a1 = 0.6 and a12 = –0.3, then specify `'AR',{0.6,-0.3},'ARLags',[1,12]`.

`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, `D` has value `0` (meaning no nonseasonal integration).

`Distribution`Distribution of the innovation process, εt
• Use this argument to specify a Student’s t distribution. By default, the innovation distribution is `"Gaussian"`. For example, to specify a t distribution with unknown degrees of freedom, specify `'Distribution','t'`.

• To specify a t innovation distribution with known degrees of freedom, assign `Distribution` a structure with fields `Name` and `DoF`. For example, for a t distribution with nine degrees of freedom, specify `'Distribution',struct('Name','t','DoF',9)`.

`MA`Nonseasonal MA coefficients: b1, b2,...,bq
• To set equality constraints for the MA coefficients. For example, to specify the MA coefficients in the ARIMA error model
${u}_{t}={\epsilon }_{t}+0.5{\epsilon }_{t-1}+0.2{\epsilon }_{t-2},$
specify `'MA',{0.5,0.2}`.

• You only need to specify the nonzero elements of `MA`. If the nonzero coefficients are at nonconsecutive lags, specify the corresponding lags using `MALags`.

• The coefficients must correspond to an invertible MA polynomial.

`MALags`Lags corresponding to nonzero, nonseasonal MA coefficients
• `MALags` is not a model property.

• Use this argument as a shortcut for specifying `MA` when the nonzero MA coefficients correspond to nonconsecutive lags. For example, to specify nonzero MA coefficients at lags 1 and 4, e.g.,
${u}_{t}={\epsilon }_{t}+{b}_{1}{\epsilon }_{t-1}+{b}_{4}{\epsilon }_{t-4},$
specify `'MALags',[1,4]`.

• Use `MA` and `MALags` together to specify known nonzero MA coefficients at nonconsecutive lags. For example, if in the given MA(4) error model b1 = 0.5 and b4 = 0.2, specify `'MA',{0.4,0.2},'MALags',[1,4]`.

`Variance`Scalar variance, σ2, of the innovation process, εt

To set equality constraints for σ2. For example, for an ARIMA error model with known innovation variance 0.1, specify `'Variance',0.1`. By default, `Variance` has value `NaN`.

Use the name-value pair arguments in the following table in conjunction with those in Name-Value Pair Arguments for Nonseasonal ARIMA Error Models to specify the regression components of the regression model with ARIMA errors:

 $\begin{array}{c}{y}_{t}=c+{X}_{t}\beta +{u}_{t}\\ a\left(L\right){\left(}^{1}=b\left(L\right){\epsilon }_{t}.\end{array}$ (2)

Name-Value Pair Arguments for the Regression Component of the regARIMA Model

NameCorresponding Model Term(s) in Equation 2When to Specify
`Beta`Regression coefficient values corresponding to the predictor series, β
• Use this argument to specify the values of the coefficients of the predictor series. For example, use `'Beta',[0.5 7 -2]` to specify
$\beta ={\left[\begin{array}{ccc}0.5& 7& -2\end{array}\right]}^{\prime }.$

• By default, `Beta` is an empty vector, `[]`.

`Intercept`Intercept term for the regression model, c
• To set equality constraints for c. For example, for a model with no intercept term, specify `'Intercept',0`.

• By default, `Intercept` has value `NaN`.

If the time series has seasonality s, then

• The degree ps seasonal autoregressive polynomial is A(L) = 1 – A 1LA2L2 –...– ApsLps.

• The degree qs seasonal moving average polynomial is B(L) 1 + B 1L + B2L2 +...+ BqsLqs.

• The degree s seasonal integration polynomial is (1 – Ls).

Use the name-value pair arguments in the following table in conjunction with those in tables Name-Value Pair Arguments for Nonseasonal ARIMA Error Models and Name-Value Pair Arguments for the Regression Component of the regARIMA Model to specify the regression model with multiplicative seasonal ARIMA errors:

 $\begin{array}{c}{y}_{t}=c+{X}_{t}\beta +{u}_{t}\\ a\left(L\right){\left(}^{1}A\left(L\right)\left(1-{L}^{s}\right){u}_{t}=b\left(L\right)B\left(L\right){\epsilon }_{t}.\end{array}$ (3)

Name-Value Pair Arguments for Seasonal ARIMA Models

ArgumentCorresponding Model Term(s) in Equation 3When to Specify
`SAR`Seasonal AR coefficients: A1, A2,...,Aps
• To set equality constraints for the seasonal AR coefficients.

• Use `SARLags` to 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,...).
For example, to specify the ARIMA error model
$\left(1-0.8L\right)\left(1-0.2{L}^{12}\right){u}_{t}={\epsilon }_{t},$
specify `'AR',0.8,'SAR',0.2,'SARLags',12`.

• The coefficients must correspond to a stable seasonal AR polynomial.

`SARLags`Lags corresponding to nonzero seasonal AR coefficients, in the periodicity of the responses
• `SARLags` is not a model property.

• Use this argument when specifying `SAR` to indicate the lags of the nonzero seasonal AR coefficients. For example, to specify the ARIMA error model
$\left(1-{a}_{1}L\right)\left(1-{A}_{12}{L}^{12}\right){u}_{t}={\epsilon }_{t},$
specify `'ARLags',1,'SARLags',12`.

`SMA`Seasonal MA coefficients: B1, B2,...,Bqs
• To set equality constraints for the seasonal MA coefficients.

• Use `SMALags` to 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,...).
For example, to specify the ARIMA error model
${u}_{t}=\left(1+0.6L\right)\left(1+0.2{L}^{4}\right){\epsilon }_{t},$
specify `'MA',0.6,'SMA',0.2,'SMALags',4`.

• The coefficients must correspond to an invertible seasonal MA polynomial.

`SMALags`Lags corresponding to the nonzero seasonal MA coefficients, in the periodicity of the responses
• `SMALags` is not a model property.

• Use this argument when specifying `SMA` to indicate the lags of the nonzero seasonal MA coefficients. For example, to specify the model
${u}_{t}=\left(1+{b}_{1}L\right)\left(1+{B}_{4}{L}^{4}\right){\epsilon }_{t},$
specify `'MALags',1,'SMALags',4`.

`Seasonality`Seasonal periodicity, s
• To specify the degree of seasonal integration s in the seasonal differencing polynomial Δs = 1 – Ls. For example, to specify the periodicity for seasonal integration of quarterly data, specify `'Seasonality',4`.

• By default, `Seasonality` has value `0` (meaning no periodicity nor seasonal integration).

Note

You cannot assign values to the properties `P` and `Q`. For multiplicative ARIMA error models,

• `regARIMA` sets `P` equal to p + D + ps + s.

• `regARIMA` sets `Q` equal to q + qs

### Specify Linear Regression Models Using Econometric Modeler App

You can specify the predictor variables in the regression component, and the error model lag structure and innovation distribution, using the Econometric Modeler app. The app treats all coefficients as unknown and estimable.

At the command line, open the Econometric Modeler app.

`econometricModeler`

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

In the app, you can see all supported models by selecting a time series variable for the response in the Time Series pane. Then, on the Econometric Modeler tab, in the Models section, click the arrow to display the models gallery.

The Regression Models section contains supported regression models. To specify a multiple linear regression (MLR) model, select `MLR`. To specify regression models with ARMA errors, select `RegARMA`.

After you select a model, the app displays the `Type` Model Parameters dialog box, where `Type` is the model type. This figure shows the RegARMA Model Parameters dialog box.

Adjustable parameters depend on the model `Type`. In general, adjustable parameters include:

• Predictor variables for the linear regression component, listed in the Predictors section.

• For regression models with ARMA errors, you must include at least one predictor in the model. To include a predictor, select the corresponding check box in the Include? column.

• For MLR models, you can clear all check boxes in the Include? column. In this case, you can specify a constant mean model (intercept-only model) by selecting the Include Intercept check box. Or, you can specify an error-only model by clearing the Include Intercept check box.

• The innovation distribution and nonseasonal lags for the error model, for regression models with ARMA errors.

As you adjust parameter values, the equation in the Model Equation section changes to match your specifications. Adjustable parameters correspond to input and name-value pair arguments described in the previous sections and in the `regARIMA` reference page.

For more details on specifying models using the app, see Fitting Models to Data and Specifying Lag Operator Polynomials Interactively.