Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# arima class

Superclasses:

Create ARIMA or ARIMAX time series model

## Description

arima creates model objects for stationary or unit root nonstationary linear time series model. This includes moving average (MA), autoregressive (AR), mixed autoregressive and moving average (ARMA), integrated (ARIMA), multiplicative seasonal, and linear time series models that include a regression component (ARIMAX).

Specify models with known coefficients, estimate coefficients with data using estimate, or simulate models with simulate. By default, the variance of the innovations is a positive scalar, but you can specify any supported conditional variance model, such as a GARCH model.

## Construction

Mdl = arima creates an ARIMA model of degrees zero.

Mdl = arima(p,D,q) creates a nonseasonal linear time series model using autoregressive degree p, differencing degree D, and moving average degree q.

Mdl = arima(Name,Value) creates a linear time series model using additional options specified by one or more Name,Value pair arguments. Name is the property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

### Note

You can only use these arguments for nonseasonal models. For seasonal models, use the name-value syntax.

 p Positive integer indicating the degree of the nonseasonal autoregressive polynomial. D Nonnegative integer indicating the degree of nonseasonal integration in the linear time series. q Positive integer indicating the degree of the nonseasonal moving average polynomial.

#### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

 'AR' Cell vector of nonseasonal autoregressive coefficients corresponding to a stable polynomial. When specified without ARLags, AR is a cell vector of coefficients at lags 1,2,... to the degree of the nonseasonal autoregressive polynomial. When specified with ARLags, AR is an equivalent-length cell vector of coefficients associated with the lags in ARLags. Default: Cell vector of NaNs. 'ARLags' Vector of positive integer lags associated with the AR coefficients. Default: Vector of integers 1,2,... to the degree of the nonseasonal autoregressive polynomial. 'Beta' Real vector of coefficients corresponding to the regression component in an ARIMAX conditional mean model. Default: [] (no regression coefficients corresponding to a regression component) 'Constant' Scalar constant in the linear time series. Default: NaN 'D' Nonnegative integer indicating the degree of the nonseasonal differencing lag operator polynomial (the degree of nonseasonal integration) in the linear time series. Default: 0 (no nonseasonal integration) 'Distribution' Conditional probability distribution of the innovation process. Distribution is 'Gaussian' or 't'. Alternatively, specify it as a data structure with the field Name to store the distribution 'Gaussian' or 't'. If the distribution is 't', then the structure also needs the field DoF to store the degrees of freedom. Default: 'Gaussian' 'MA' Cell vector of nonseasonal moving average coefficients corresponding to an invertible polynomial. When specified without MALags, MA is a cell vector of coefficients at lags 1,2,... to the degree of the nonseasonal moving average polynomial. When specified with MALags, MA is an equivalent-length cell vector of coefficients associated with the lags in MALags. Default: Cell vector of NaN values. 'MALags' Vector of positive integer lags associated with the MA coefficients. Default: Vector of integers 1,2,... to the degree of the nonseasonal moving average polynomial. 'SAR' Cell vector of seasonal autoregressive coefficients corresponding to a stable polynomial. When specified without SARLags, SAR is a cell vector of coefficients at lags 1,2,... to the degree of the seasonal autoregressive polynomial. When specified with SARLags, SAR is an equivalent-length cell vector of coefficients associated with the lags in SARLags. Default: Cell vector of NaNs. 'SARLags' Vector of positive integer lags associated with the SAR coefficients. Default: Vector of integers 1,2,... to the degree of the seasonal autoregressive polynomial. 'SMA' Cell vector of seasonal moving average coefficients corresponding to an invertible polynomial. When specified without SMALags, SMA is a cell vector of coefficients at lags 1,2,... to the degree of the seasonal moving average polynomial. When specified with SMALags, SMA is an equivalent-length cell vector of coefficients associated with the lags in SMALags. Default: Cell vector of NaNs. 'SMALags' Vector of positive integer lags associated with the SMA coefficients. Default: Vector of integers 1,2,... to the degree of the seasonal moving average polynomial. 'Seasonality' Nonnegative integer indicating the degree of the seasonal differencing lag operator polynomial in the linear time series model. Default: 0 (no seasonal integration) 'Variance' Positive scalar variance of the model innovations, or a supported conditional variance model object (e.g., a garch model object). Default: NaN 'Description' String scalar or character vector describing the model. By default, this argument describes the parametric form of the model, for example, "ARIMA(1,1,1) Model (Gaussian Distribution)".

### Notes

• Each AR, SAR, MA, and SMA coefficient is associated with an underlying lag operator polynomial and is subject to a near-zero tolerance exclusion test. That is, the software compares each coefficient to the default lag operator zero tolerance, 1e-12. If the magnitude of a coefficient is greater than 1e-12, then the software includes it in the model. Otherwise, the software considers the coefficient sufficiently close to 0, and excludes it from the model. For additional details, see LagOp.

• Specify the lags associated with the seasonal polynomials SAR and SMA in the periodicity of the observed data, and not as multiples of the Seasonality parameter. This convention does not conform to standard Box and Jenkins [1] notation, but it is a more flexible approach for incorporating multiplicative seasonality.

## Properties

 AR Cell vector of nonseasonal autoregressive coefficients corresponding to a stable polynomial. Associated lags are 1,2,... to the degree of the nonseasonal autoregressive polynomial, or as specified in ARLags. Beta Real vector of regression coefficients corresponding to a regression component. Constant Scalar constant in the linear time series model. D Nonnegative integer indicating the degree of nonseasonal integration in the linear time series. Description String scalar for the model description. Distribution Data structure for the conditional probability distribution of the innovation process. The field Name stores the distribution name "Gaussian" or "t". If the distribution is "t", then the structure also has the field DoF to store the degrees of freedom. MA Cell vector of nonseasonal moving average coefficients corresponding to an invertible polynomial. Associated lags are 1,2,... to the degree of the nonseasonal moving average polynomial, or as specified in MALags. P Degree of the compound autoregressive polynomial. P is the total number of lagged observations necessary to initialize the autoregressive component of the model. P includes the effects of nonseasonal and seasonal integration captured by the properties D and Seasonality, respectively, and the nonseasonal and seasonal autoregressive polynomials AR and SAR, respectively. The property P does not necessarily conform to standard Box and Jenkins notation. It only conforms if the model has no integration nor seasonal autoregressive component. Q Degree of the compound moving average polynomial. Q is the total number of lagged innovations necessary to initialize the moving average component of the model. Q includes the effects of nonseasonal and seasonal moving average polynomials MA and SMA, respectively. The property Q does not necessarily conform to standard Box and Jenkins notation. It only conforms if the model has no seasonal moving average component. SAR Cell vector of seasonal autoregressive coefficients corresponding to a stable polynomial. Associated lags are 1,2,... to the degree of the seasonal autoregressive polynomial, or as specified in SARLags. SMA Cell vector of seasonal moving average coefficients corresponding to an invertible polynomial. Associated lags are 1,2,... to the degree of the seasonal moving average polynomial, or as specified in SMALags. Seasonality Nonnegative integer indicating the seasonal differencing polynomial degree in the linear time series model. Variance Positive scalar variance of the model innovations, or a supported conditional variance model (e.g., a garch model).

## Methods

 estimate Estimate ARIMA or ARIMAX model parameters filter Filter disturbances using ARIMA or ARIMAX model forecast Forecast ARIMA or ARIMAX model responses or conditional variances impulse Impulse response function infer Infer ARIMA or ARIMAX model residuals or conditional variances print (To be removed) Display parameter estimation results for ARIMA or ARIMAX models simulate Monte Carlo simulation of ARIMA or ARIMAX models summarize Display ARIMA model estimation results

## Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).

## Examples

collapse all

Specify an ARIMA(2,1,2) model,

$\left(1-{\varphi }_{1}L-{\varphi }_{2}{L}^{2}\right)\left(1-L\right){y}_{t}=\left(1+{\theta }_{1}L+{\theta }_{2}{L}^{2}\right){\epsilon }_{t}$

Mdl = arima(2,1,2)
Mdl =
arima with properties:

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

The model is nonseasonal, so you can use shorthand syntax. The result is a model with two nonseasonal AR coefficients ($p$ = 2), two nonseasonal MA coefficients ($q$ = 2), and one degree of differencing ($D$ = 1). The property P is equal to $p$ + $D$ = 3. NaN values indicate estimable parameters.

Create, and then modify an arima model.

Specify an AR(3) model with known coefficients,

${y}_{t}=0.05+0.6{y}_{t-1}+0.2{y}_{t-2}-0.1{y}_{t-3}+{\epsilon }_{t},$

where ${\epsilon }_{t}$ has a Gaussian distribution with mean 0 and variance 0.01.

Mdl = arima('Constant',0.05,'AR',{0.6,0.2,-0.1},...
'Variance',0.01)
Mdl =
arima with properties:

Description: "ARIMA(3,0,0) Model (Gaussian Distribution)"
Distribution: Name = "Gaussian"
P: 3
D: 0
Q: 0
Constant: 0.05
AR: {0.6 0.2 -0.1} at lags [1 2 3]
SAR: {}
MA: {}
SMA: {}
Seasonality: 0
Beta: [1×0]
Variance: 0.01

Modify the model object to make all the model parameters unknown (set them to NaN).

Mdl.Constant = NaN;
Mdl.AR = {NaN NaN NaN};
Mdl.Variance = NaN
Mdl =
arima with properties:

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

Make the innovation distribution a $t$ distribution with 10 degrees of freedom.

tdist = struct('Name','t','DoF',10);
Mdl.Distribution = tdist
Mdl =
arima with properties:

Description: "ARIMA(3,0,0) Model (t Distribution)"
Distribution: Name = "t", DoF = 10
P: 3
D: 0
Q: 0
Constant: NaN
AR: {NaN NaN NaN} at lags [1 2 3]
SAR: {}
MA: {}
SMA: {}
Seasonality: 0
Beta: [1×0]
Variance: NaN

Specify an MA model with no constant, and moving average terms at lags 1, 2, and 12,

${y}_{t}={\epsilon }_{t}+{\theta }_{1}{\epsilon }_{t-1}+{\theta }_{2}{\epsilon }_{t-2}+{\theta }_{12}{\epsilon }_{t-12}.$

Mdl = arima('Constant',0,'MALags',[1,2,12])
Mdl =
arima with properties:

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

Specify a multiplicative seasonal ARIMA model with seasonal and nonseasonal integration,

$\left(1-L\right)\left(1-{L}^{12}\right){y}_{t}=\left(1+{\theta }_{1}\right)\left(1+{\theta }_{12}{L}^{12}\right){\epsilon }_{t}.$

Mdl = arima('Constant',0,'D',1,'Seasonality',12,...
'MALags',1,'SMALags',12)
Mdl =
arima with properties:

Description: "ARIMA(0,1,1) Model Seasonally Integrated with Seasonal MA(12) (Gaussian Distribution)"
Distribution: Name = "Gaussian"
P: 13
D: 1
Q: 13
Constant: 0
AR: {}
SAR: {}
MA: {NaN} at lag [1]
SMA: {NaN} at lag [12]
Seasonality: 12
Beta: [1×0]
Variance: NaN

An ARIMA model is assumed to be multiplicative any time SMALags or SARLags are specified.

Specify an ARIMAX model with one or more regression coefficients corresponding to predictor data.

Specify the ARIMAX(1,1,1) model,

$\left(1-0.2L\right)\left(1-L{\right)}^{1}{y}_{t}=0.5{x}_{t}+\left(1+0.3L\right){\epsilon }_{t}$

using arima.

Mdl = arima('AR',0.2,'D',1,'MA',0.3,'Beta',0.5)
Mdl =
arima with properties:

Description: "ARIMAX(1,1,1) Model (Gaussian Distribution)"
Distribution: Name = "Gaussian"
P: 2
D: 1
Q: 1
Constant: NaN
AR: {0.2} at lag [1]
SAR: {}
MA: {0.3} at lag [1]
SMA: {}
Seasonality: 0
Beta: [0.5]
Variance: NaN

In the output, the property P is sum of the AR lags and degree of nonseasonal integration p + D = 2.

Modify this ARIMAX(1,1,1) model by adding two more regression coefficients,

Mdl.Beta=[0.5,4,-0.6]
Mdl =
arima with properties:

Description: "ARIMAX(1,1,1) Model (Gaussian Distribution)"
Distribution: Name = "Gaussian"
P: 2
D: 1
Q: 1
Constant: NaN
AR: {0.2} at lag [1]
SAR: {}
MA: {0.3} at lag [1]
SMA: {}
Seasonality: 0
Beta: [0.5 4 -0.6]
Variance: NaN

Specify an ARIMA(1,0,1) conditional mean model with a GARCH(1,1) conditional variance model.

Specify the conditional mean model.

Mdl = arima(1,0,1);

Specify the conditional variance model.

Mdl.Variance = garch(1,1)
Mdl =
arima with properties:

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