简体   繁体   English

使用Arima()预测平稳序列

[英]Forecasting a stationary series with Arima()

I am working on a forecasting exercise. 我正在做一个预测练习。 The preferred model is an ARIMA (0,0,1) (0,1,1)4 in which there are three exogenous variables (Forestalling.1, Forestalling.2, Break). 首选模型是ARIMA(0,0,1)(0,1,1)4,其中有三个外生变量(Forestalling.1,Forestalling.2,Break)。

My dependent variable is Pmean , the average house price, and the exogenous variables are dummy variable that indicate changes in the legislation and the property crisis (these variables are made of the following values 0, 1, -1). 我的因变量是Pmean ,即平均房价,外生变量是虚拟变量,它们指示立法变化和财产危机(这些变量由以下值0、1,-1组成)。

My initial approach was to differentiate the original and fit the Arima model; 我最初的方法是区分原始模型并适合Arima模型。 however this causes me trouble when trying to forecast the series as the forecast is done on the stationary series - diff(log(x$Pmean),4) 但这在尝试预测序列时给我带来麻烦,因为对固定序列进行了预测diff(log(x$Pmean),4)

fit = Arima(diff(log(x$Pmean),4),
      order=c(1,0,0),
      seasonal=list(order=c(0,0,1), period =4),
      xreg=xregvariables)

               Estimate Std. Error z value  Pr(>|z|)    
ar1             0.686212   0.128593  5.3363 9.485e-08 ***
sma1           -0.583000   0.110908 -5.2566 1.467e-07 ***
intercept       0.101515   0.010318  9.8386 < 2.2e-16 ***
Forestalling 1  0.035008   0.011365  3.0804  0.002067 ** 
Forestalling 2 -0.033731   0.013151 -2.5649  0.010320 *  
Break          -0.087386   0.013113 -6.6640 2.664e-11 ***

AIC=-216.75

I tried to fit an alternative model in which I incorporate the seasonal differences, but the results are not optimal, and my estimates are not significant. 我试图拟合一个包含季节性差异的替代模型,但结果并非最佳,我的估计也不重要。 They even return a different directions for some of the parameters (Forestalling2); 他们甚至为某些参数返回不同的方向(Forestalling2); it has a negative effect in the original model and a positive (null) effect in the second. 它对原始模型有负面影响,而在第二个模型中有正面(无效)影响。

  fit = Arima(log(x$Pmean)
       order=c(1,0,0),
       seasonal=list(order=c(0,1,1), period =4),
       xreg=xregvariables ,
       include.drift = TRUE)

z test of coefficients:

                  Estimate  Std. Error z value  Pr(>|z|)    
ar1             0.97042096  0.03430919 28.2846 < 2.2e-16 ***
sma1           -0.53044592  0.13689248 -3.8749 0.0001067 ***
drift           0.01407096  0.01016345  1.3845 0.1662158    
Forestalling 1  0.03475176  0.01210626  2.8706 0.0040974 ** 
Forestalling 2  0.00094803  0.01343471  0.0706 0.9437434    
Break          -0.01077423  0.02376049 -0.4535 0.6502236   

AIC=-206.84

Would anyone know if it is possible to retransform the series in my first model so I can forecast the original series log(x$Pmean) or x$Pmean using the model estimates? 谁知道在我的第一个模型中是否可以重新变换序列,以便可以使用模型估计量预测原始序列log(x$Pmean)x$Pmean

If that it not possible, is it possible to internalize the differencing in the second Arima model and have the same results model as the first model? 如果不可能,是否有可能在第二个Arima模型中内部化差异并具有与第一个模型相同的结果模型?

Thanks 谢谢

In the first first Arima model, 在第一个有马模型中

fit=Arima(diff(log(x$Pmean),4),
  order=c(1,0,0),
  seasonal=list(order=c(0,0,1), period =4),
  xreg=xregvariables)

it looks like you are taking the first seasonal difference manually. 看来您正在手动处理第一个季节差异。 This should be equivalent to the Arima model, 这应该等效于Arima模型,

fit=Arima(log(x$Pmean),
  order=c(1,0,0),
  seasonal=list(order=c(0,1,1), period =4),
  xreg=xregvariables)

which takes the seasonal first difference. 这需要季节性的第一差异。 Then you can use the "fpp" package to automatically form forecasts for the logged data. 然后,您可以使用“ fpp”包为记录的数据自动形成预测。

library(fpp)
forecast(fit,h=12,xreg=x_test)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM