主要内容

arima

班级:regARIMA

Convert regression model with ARIMA errors to ARIMAX model

Syntax

Arimax = Arima(MDL)
[Arimax,Xnew] = Arima(MDL,名称,值)

描述

Thearima对象函数将带有Arima错误的指定回归模型转换(regARIMAmodel object) to the equivalent ARIMAX model (arimamodel object). To create an ARIMAX model directly, seearima

Arimax= arima(MDL)使用ARIMA时间序列错误转换单变量回归模型MDLto a model of typearima包括回归分量(ARIMAX)。

[Arimax,XNew] = Arima(Arima(MDL,Name,Value)returns an updated regression matrix of predictor data using additional options specified by one or moreName,Value配对参数。

Input Arguments

MDL

Regression model with ARIMA time series errors, as created byregARIMA或者estimate

Name-Value Arguments

将可选的参数对Name1=Value1,...,NameN=ValueN, whereName是个argument name and价值是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

X

预测数据的回归组件MDL, specified as the comma-separated pair consisting of'X'和a matrix.

最后一行Xcontains the latest observation of each series.

每一列Xis a separate time series.

Output Arguments

Arimax

Arimax模型等于具有Arima错误的回归模型MDL, returned as a model of typearima

XNew

Updated predictor data matrix for the regression component ofArimax, returned as a matrix.

XNewhas the same number of rows asX。最后一行XNewcontains the latest observation of each series.

每一列XNewis a separate time series. The number of columns ofXNew是一个加上差异方程中非零自回归系数的数量MDL

例子

expand all

使用ARMA(4,1)错误将回归模型转换为Arimax模型arima转换器。

用ARMA(4,1) errors:

y t = 1 + 0 5 X t + u t u t = 0 8 u t - 1 - 0 4 u t - 4 + ε t + 0 3 ε t - 1 ,

where ε t is Gaussian with mean 0 and variance 1.

MDL= regARIMA('AR',{0.8, -0.4},'嘛',0.3,。。。'arlags',[1 4],'Intercept',1,'Beta',0.5,。。。'Variance',1)
mdl =带有属性的雷加里玛:描述:“使用ARMA(4,1)错误模型(高斯分布)回归:分布:name =“高斯”截距:1 beta:[0.5] p:4 q:4 q:1 ar:{0.8  -  {0.8  -  {0.8  -0.4}在滞后[1 4] sar:{} ma:{0.3} lag [1] sma:{}方差:1

You can verify that the lags of the autoregressive terms are14在里面AR排。

Generate random predictor data.

RNG(1);%可再现性T = 20; X = randn(T,1);

ConvertMDLto an ARIMAX model.

[Arimax,Xnew] = Arima(MDL,'X',X); ARIMAX
Arimax= arima with properties: Description: "ARIMAX(4,0,1) Model (Gaussian Distribution)" Distribution: Name = "Gaussian" P: 4 D: 0 Q: 1 Constant: 0.6 AR: {0.8 -0.4} at lags [1 4] SAR: {} MA: {0.3} at lag [1] SMA: {} Seasonality: 0 Beta: [1 -0.8 0.4] Variance: 1

新的arimamodel,Arimax, 是

y t = 0 6 + Z t γ + 0 8 y t - 1 - 0 4 y t - 4 + ε t + 0 3 ε t - 1 ,

where

Z t γ = [ 0 5 x 1 N a N N a N 0 5 x 2 0 5 x 1 N a N 0 5 x 3 0 5 x 2 N a N 0 5 x 4 0 5 x 3 N a N 0 5 x 5 0 5 x 4 0 5 x 1 0 5 T 0 5 x T - 1 0 5 x T - 4 ] [ 1 - 0 8 0 4 ]

x j is rowjX。自自回归和的产物integration polynomials is ϕ ( L ) = ( 1 - 0 8 L + 0 4 L 4 ) , arimax.betais simply[1 -0.8 0.4]。Note that the software carries over the autoregressive and moving average coefficients fromMDLtoArimax。还,MDL。Intercept= 1和Arimax。Constant= (1 - 0.8 + 0.4)(1) = 0.6, i.e., theregARIMA模型截距和arima模型常数通常不等。

Convert a regression model with seasonal ARIMA errors to an ARIMAX model using thearima转换器。

A R I M A ( 2 , 1 , 1 ) × ( 1 , 1 , 0 ) 2 错误:

y t = X t [ - 2 1 ] + u t ( 1 - 0 3 L + 0 1 5 L 2 ) ( 1 - L ) ( 1 - 0 2 L 2 ) ( 1 - L 2 ) u t = ( 1 + 0 1 L ) ε t ,

where ε t is Gaussian with mean 0 and variance 1.

MDL= regARIMA('AR',{0.3,-0.15},'嘛',0.1,。。。'arlags',[1 2],'sar',0.2,'sarlags',2,。。。'Intercept',0,'Beta',[-2; 1],'Variance',1,'D',1,。。。'Seasonality',2)
mdl =带有属性的雷加里玛(Regarima):描述:“与arima(2,1,1)的回归误差模型与季节性AR(2)(高斯分布)(高斯分布)”“分布:name =“ Gaussian”截距:0 beta:0 beta:[-2 1 1] p:7 d:1 q:1 ar:{0.3 -0.15} lags [1 2] sar:{0.2}在lag [2] ma:{0.1} lag [1] sma:{0.1} sma:{}季节性:2方差:1

生成预测数据。

RNG(1);%可再现性T = 20; X = randn(T,2);

ConvertMDLto an ARIMAX model.

[Arimax,Xnew] = Arima(MDL,'X',X); ARIMAX
Arimax =具有属性的Arima:Description:“ Arimax(2,1,1)季节性与季节性AR(2)(高斯分布)”的模型“分布:名称=“ Gaussian” P:7 D:7 D:1 Q:1 Q:1常数:0AR:{0.3 -0.15}在滞后[1 2] SAR:{0.2} lag [2] ma:{0.1}在lag [1] sma:{}季节性:2 beta:[1 -1-1.3 -0.75 1.41-1.41--0.34 -0.08 0.09 -0.03]方差:1

mdl.betahas length 2, butarimax.betahas length 8. This is because the product of the autoregressive and integration polynomials, ϕ ( L ) ( 1 - L ) φ ( L ) ( 1 - L s ) , 是

1 - 1 3 L - 0 7 5 L 2 + 1 4 1 L 3 - 0 3 4 L 4 - 0 0 8 L 5 + 0 0 9 L 6 - 0 0 3 L 7

You can see that when you add seasonality, seasonal lag terms, and integration to a model, the size ofXNew可以长大。这样的转换可能不是涉及小样本量的分析的理想选择。

算法

X表示串联预测数据矢量(或设计矩阵)的矩阵和βdenote the regression component for the regression model with ARIMA errors,MDL

  • 如果指定X, thenarimareturnsXNewin a certain format. Suppose that the nonzero autoregressive lag term degrees ofMDL是0 <a1<a2< ...<P, which is the largest lag term degree. The software obtains these lag term degrees by expanding and reducing the product of the seasonal and nonseasonal autoregressive lag polynomials, and the seasonal and nonseasonal integration lag polynomials

    ϕ ( L ) ( 1 L ) D φ ( L ) ( 1 L s )

    • The first column ofXNewis

    • 第二列XNewis a sequence ofa1NaNs, and then the product X a 1 β , where X a 1 β = L a 1 X β

    • Thejth column ofXNewis a sequence ofajNaNs, and then the product X a j β , where X a j β = L a j X β

    • The last column ofXNewis a sequence ofapNaNs, and then the product X p β , where X p β = L p X β

    Suppose thatMDL是Arima(3,1,0)错误的回归模型,并且ϕ1= 0.2 andϕ3= 0.05. Then the product of the autoregressive and integration lag polynomials is

    ( 1 0.2 L 0.05 L 3 ) ( 1 L ) = 1 1.2 L + 0.02 L 2 0.05 L 3 + 0.05 L 4

    This implies thatarimax.betais[1 -1.2 0.02 -0.05 0.05]XNewis

    [ x 1 β N a N N a N N a N N a N x 2 β x 1 β N a N N a N N a N x 3 β x 2 β x 1 β N a N N a N x 4 β x 3 β x 2 β x 1 β N a N x 5 β x 4 β x 3 β x 2 β x 1 β x T β x T 1 β x T 2 β x T 3 β x T 4 β ] ,

    wherexj是个jth row ofX

  • If you do not specifyX, thenarimareturnsXNew作为无行的空矩阵,一加上一个非零自动回归系数的数量MDLcolumns.