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.