auto.arima函数中平稳= TRUE的含义 [英] meaning of stationary=TRUE in auto.arima function

查看:100
本文介绍了auto.arima函数中平稳= TRUE的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个数据,这是从预测值和观察值获得的残差序列.原始系列是随机行走,漂移很小(平均值= 0.0025).

  err<-ts(c(0.6100,1.3500,1.0300,0.9600,1.1100,0.8350,0.8800,1.0600,1.3800,1.6200,1.5800,1.2800,1.3000,1.4300,2.1500,1.9100,1.8300,​​1.9500,1.9999,1.8500,1.5500,1.9800,1.7044,1.8593,1.9900,2.0400,1.8950,2.0100,1.6900,2.1800,2.2150,2.1293,2.1000,2.1200,2.0500,1.9000,1.8350,1.9000,1.9500,1.7800,1.5950,1.8500,1.8400,1.5800,1.6100,1.7200,1.8500,1.6700,1.8050,1.9400,1.5000,1.3100,1.4864,1.2400,0.9300,1.1400,-0.6100,-0.4300,-0.4700,-0.3450),频率= 7,开始= c(23,1),end = c(31,4)) 

我知道这个残差序列具有一些Seriel相关性,可以用 ARIMA 进行建模.

  acf(err [1:length(err)]); pacf(err [1:length(err)]))#x轴从零开始.#在这里仅显示整数滞后,与整个季节性周期相同.#显示它通常可以由MA模型拟合. 

我尝试了以下配件:

 库(预测)m1 <-auto.arima(err,固定= T,allowmean = T)#输出#ARIMA(2,0,0)为零均值#系数:#ar1 ar2#0.7495 0.2254#s.e.0.1301 0.1306#sigma ^ 2估计为0.104:对数似然= -17.65#AIC = 41.29 AICc = 41.72 BIC = 47.58m2<-auto.arima(err,allowmean = T)# 输出#ARIMA(0,2,2)#系数:#ma1 ma2#-1.3053 0.3850#s.e.0.1456 0.1526#sigma ^ 2估计为0.1043:对数似然= -16.97#AIC = 39.94 AICc = 40.38 BIC = 46.12 

如果我们参考 auto.arima 的帮助页面,则会看到:

stationary:如果为TRUE,则将搜索范围限制为固定模型.

err acf pacf 中,我们可以看到它是由 MA 拟合的模型而不是 AR ,为什么 auto.arima 给我一个 AR 合适?

我的理解是 m1 m2 都应该是固定的,然后这个 stationary 参数的目的是什么?

现在,如果我们绘制这两个模型的根,将更加有趣:

如果查看根图,虽然m1 $残差是白噪声,但当 stationary = T (m1)时的模型比 m2 平稳的模型.

解决方案

我无法回答第一个问题,但是关于第二个问题, auto.arima()实际上可以生成非平稳模型以适合给定的时间序列."i"代表集成,表示可以使用集成.您可以通过获取每个观测值与先前观测值的差异(差异)来转换大多数(全部?)非平稳模型(非常类似于微积分中的导数),然后通过积分将其转换回原始时间序列.

因此,如果您不想让 auto-arima()生成非平稳模型,则可以使用 stationary 参数,从根本上限制了它的查找范围.适合使用较简单的ARMA模型.

I have this data which is residual series obtained from predicted values and observations. original series was a random walk with a very small drift(mean=0.0025).

err <- ts(c(0.6100, 1.3500, 1.0300, 0.9600, 1.1100, 0.8350 , 0.8800 , 1.0600 , 1.3800 , 1.6200,  1.5800 , 1.2800 , 1.3000 , 1.4300 , 2.1500 , 1.9100 , 1.8300 , 1.9500  ,1.9999, 1.8500 , 1.5500 , 1.9800  ,1.7044  ,1.8593 , 1.9900 , 2.0400, 1.8950,  2.0100 , 1.6900 , 2.1800 ,2.2150,  2.1293 , 2.1000 , 2.1200 , 2.0500 , 1.9000,  1.8350, 1.9000 ,1.9500 , 1.7800 , 1.5950,  1.8500 , 1.8400,  1.5800, 1.6100 , 1.7200 , 1.8500 , 1.6700,  1.8050,  1.9400,  1.5000 , 1.3100 , 1.4864,  1.2400 , 0.9300 , 1.1400, -0.6100, -0.4300 ,-0.4700 ,-0.3450), frequency = 7, start = c(23, 1), end = c(31, 4))

and I know this residual series has some seriel correlations and can be modeled by ARIMA.

acf(err[1:length(err)]);pacf(err[1:length(err)])
# x axis starts with zero.
# showing only integer lags here, same plot as full seasonal periods. 
# shows it typically can be fitted by a MA model.

I have attempted following fittings:

library(forecast)

m1 <- auto.arima(err, stationary=T, allowmean=T)
#output
# ARIMA(2,0,0) with zero mean 

# Coefficients:

#         ar1     ar2
#      0.7495  0.2254
# s.e.  0.1301  0.1306

# sigma^2 estimated as 0.104:  log likelihood=-17.65
# AIC=41.29   AICc=41.72   BIC=47.58

m2 <- auto.arima(err, allowmean=T)
# output
# ARIMA(0,2,2) 

# Coefficients:
#          ma1     ma2
#      -1.3053  0.3850
# s.e.   0.1456  0.1526

# sigma^2 estimated as 0.1043:  log likelihood=-16.97
# AIC=39.94   AICc=40.38   BIC=46.12

if we refer to auto.arima's help page we see that:

stationary: If TRUE, restricts search to stationary models.

From the acf and pacf of err we can see that it is to be fitted by an MA model rather than AR, why does auto.arima give me an AR fit?

My understanding is that both m1 and m2 should be stationary, then what's the purpose of this stationary argument?

it's even more interesting now, if we plot the roots of these two models:

the model when stationary=T (m1) is less stationary than m2 if we look at the roots plot, although m1$residuals is white noise.

解决方案

I can't answer the first question, but regarding the second, auto.arima() can actually generate non-stationary models to fit the given time series. The 'i' stands for integrated, meaning it can use integration. You can transform most (all?) non-stationary models by taking the difference (diff) of each observation from the previous (much like a derivative in calculus), and then transform it back to the original time-series by integrating.

So, if you don't want to let auto-arima() generate non-stationary models, then you use the stationary argument, basically limiting it finding a fit using the simpler ARMA models.

这篇关于auto.arima函数中平稳= TRUE的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆