2

Return series with 30 observations:

Return <- c(0.001562791, 0.0032665211, 0.0255382847, 0.0162675127,
  -0.0200315418, 0.0072259871, -0.0062112001, -0.0003623057,
  -0.017030708, -0.00029492, -0.0133622358, 0.0035062888, 0,
  -0.0017143074, -0.0053106075, -0.0002250141, 0.0054610197,
  -0.0039618815, 0.0005990266, -0.0032239953, -0.0036865708,
  -0.0027927708, -0.0040140926, -0.0015949572, 0.0104348773,
  -0.0007525021, 0.008022536, -0.0122470444, -0.0057619568, -0.0028934765
)

ARIMA(1,0,0) generation with Return[1:29]series by Arima function in R (forecast package).

library("forecast")
M_Return_1_29 <- (Arima(Return[1:29], order = c(1,0,0))) 
summary(M_Return_1_29)
## ARIMA(1,0,0) with non-zero mean 
## 
## Coefficients:
##           ar1  intercept
##       -0.0365    -0.0007
## s.e.   0.1836     0.0016
## 
## sigma^2 estimated as 8.776e-05:  log likelihood=95.33
## AIC=-184.66   AICc=-183.7   BIC=-180.56
## 
## Training set error measures:
##                        ME        RMSE         MAE MPE MAPE      MASE
## Training set 2.811408e-06 0.009039216 0.006242894 Inf  Inf 0.6230254
##                     ACF1
## Training set 0.001214897

So, when calculate one ahead prediction (prediction for 30th value for Return) by:predict(M_Return_1_29,n.ahead=1)It gives this output:

$pred
#Time Series:
#Start = 30 
#End = 30 
#Frequency = 1 
#[1] -0.0005256081

$se
#Time Series:
#Start = 30 
#End = 30 
#Frequency = 1 
#[1] 0.009368022

I would like to caculate -0.0005256081 by hand. But when I try this Ŷ30 = -0.0007 + (-0.0365*Yt29) = Ŷ30 = -0.0007 + (-0.0365*-0.0057619568) = -0.0004896885768

Note that I take -0.0057619568 as Yt29 from the original series.

Achim Zeileis
  • 13,510
  • 1
  • 29
  • 53
Cenk
  • 175
  • 1
  • 6

1 Answers1

5

See the "Details" section of ?arima (in the base stats package) which Arima() (from forecast) is based on. This clarifies the parametrization of the model and shows that the intercept is in fact the mean of the response variable which differs from the intercept in autoregressive models. More precisely: $$Y_t - \mu = \phi \cdot (Y_{t-1} - \mu).$$ Thus, the one-step ahead prediction is: $$\hat Y_{t+1|t} = \hat \mu + \hat \phi \cdot (Y_t - \hat \mu).$$ In your example

coef(M_Return_1_29)[2] + coef(M_Return_1_29)[1] *
  (Return[29] - coef(M_Return_1_29)[2])
##     intercept 
## -0.0005256081 

which matches the predict() output.

Achim Zeileis
  • 13,510
  • 1
  • 29
  • 53
  • But, `#coef(M_Return_1_29)[2] + coef(M_Return_1_29)[1] *(Return[29] - coef(M_Return_1_29)[2]) = -0.000515238` Is it because of $$\hat e_{t}$$? – Cenk Mar 12 '17 at 11:53
  • 1
    Note sure how you obtained this, I get `-0.0005256081`. First I thought that it was due to a missing comma in the replication code (which I just corrected in an edit) but that would have lead to even more different results... – Achim Zeileis Mar 12 '17 at 20:12
  • It is because I calculate it by hand, but when I calculate by your code above by R, it is ok. Appreciated! – Cenk Mar 13 '17 at 04:21