library(forecast)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(quantmod)
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: TTR
library(tseries)
library(timeSeries)
## Loading required package: timeDate
## 
## Attaching package: 'timeSeries'
## The following object is masked from 'package:zoo':
## 
##     time<-
library(xts)
#Variable plug-ins
stockname = 'AMZN'
startdate = '2015-01-01'
enddate = '2019-01-01'

#Pull data from Yahoo finance
stockvar = getSymbols(c(stockname),srs='yahoo',from=startdate,toenddate=enddate,auto.assign = FALSE)
## 'getSymbols' currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## 'loadSymbols' to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.
## 
## This message is shown once per session and may be disabled by setting 
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
stockvar = na.omit(stockvar)
#Chart time series
chartSeries(stockvar) #Represents high and low dollar value fluctuation in weekly close prices

price = stockvar[,3]

#Decompose data [Foundation of building ARIMA]
stockvar.ts = ts(price, start = 2019-01-02, frequency = 100)
stockvar.de = decompose(stockvar.ts)

plot(stockvar.de)

#Smooth data
par(mfrow = c(4,2))
#Logarithmic returns
logprice = log(price)

#Squreroot returns
sqrtprice  = sqrt(price)

#Diff. log returns
dlogprice = diff(log(price),lag = 1)
dlogprice = dlogprice[!is.na(dlogprice)]

#Diff. sqrt price returns
dsqrtprice = diff(sqrt(price),lag=1)
dsqrtprice = dsqrtprice[!is.na(dsqrtprice)]

adf.test(logprice)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  logprice
## Dickey-Fuller = -3.5498, Lag order = 11, p-value = 0.03751
## alternative hypothesis: stationary
adf.test(sqrtprice)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  sqrtprice
## Dickey-Fuller = -2.6196, Lag order = 11, p-value = 0.316
## alternative hypothesis: stationary
adf.test(dsqrtprice)
## Warning in adf.test(dsqrtprice): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  dsqrtprice
## Dickey-Fuller = -12.193, Lag order = 11, p-value = 0.01
## alternative hypothesis: stationary
adf.test(dlogprice)
## Warning in adf.test(dlogprice): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  dlogprice
## Dickey-Fuller = -12.364, Lag order = 11, p-value = 0.01
## alternative hypothesis: stationary
#Creating correlograms 
par(mfrow=c(1,2))
acf(dlogprice,main='ACF for log return')
pacf(dlogprice, main='PACF for log return')

par(mfrow=c(1,2))
acf(dsqrtprice,main='ACF for log return')
pacf(dsqrtprice, main='PACF for log return')

#Programming a fitted forecast
realreturn = xts(0,as.Date("2018-11-25","%Y-%m-%d"))

#Initialize forecasted return via dataframe
forecastreturn = data.frame(Forecasted = numeric())

split = floor(nrow(dlogprice)*(2.9/3))

for (s in split:(nrow(dlogprice)-1)) {
  dlogprice_training = dlogprice[1:s,]
  dlogprice_testing = dlogprice[(s+1):nrow(dlogprice),]
  fit = arima(dlogprice_training,order = c(2,0,2),include.mean = FALSE)
  summary(fit)
  arima.forecast = forecast(fit, h=1)
  summary(arima.forecast)
  
  Box.test(fit$residuals,lag=1,type = 'Ljung-Box')
  
  forecastreturn = rbind(forecastreturn,arima.forecast$mean[1])
  colnames(forecastreturn) = c("Forecasted")
  returnseries = dlogprice[(s+1),]
  realreturn = c(realreturn,xts(returnseries))
  rm(returnseries)
  
}
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3367  -0.3112  -0.2346  0.2449
## s.e.  0.3372   0.2536   0.3403  0.2718
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3962.88,  aic = -7915.76
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001480605 0.01851997 0.01272309 99.78973 145.0924 0.7332017
##                      ACF1
## Training set -0.005850959
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3367  -0.3112  -0.2346  0.2449
## s.e.  0.3372   0.2536   0.3403  0.2718
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3962.88,  aic = -7915.76
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001480605 0.01851997 0.01272309 99.78973 145.0924 0.7332017
##                      ACF1
## Training set -0.005850959
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1543   0.0001080032 -0.02362629 0.02384229 -0.03619046 0.03640647
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2014  -0.3078  -0.0970  0.2556
## s.e.  0.4320   0.2306   0.4364  0.2359
## 
## sigma^2 estimated as 0.0003428:  log likelihood = 3965.77,  aic = -7921.53
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001459322 0.01851619 0.01272061 100.5124 145.0138 0.7331762
##                      ACF1
## Training set -0.008088939
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2014  -0.3078  -0.0970  0.2556
## s.e.  0.4320   0.2306   0.4364  0.2359
## 
## sigma^2 estimated as 0.0003428:  log likelihood = 3965.77,  aic = -7921.53
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001459322 0.01851619 0.01272061 100.5124 145.0138 0.7331762
##                      ACF1
## Training set -0.008088939
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1544    -0.00109807 -0.02482752 0.02263138 -0.03738913 0.03519299
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2017  -0.3056  -0.0969  0.2532
## s.e.  0.4364   0.2283   0.4408  0.2338
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 3968.14,  aic = -7926.28
## 
## Training set error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001443921 0.01851851 0.01272662 100.506 145.0733 0.7336079
##                     ACF1
## Training set -0.00803751
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2017  -0.3056  -0.0969  0.2532
## s.e.  0.4364   0.2283   0.4408  0.2338
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 3968.14,  aic = -7926.28
## 
## Error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001443921 0.01851851 0.01272662 100.506 145.0733 0.7336079
##                     ACF1
## Training set -0.00803751
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1545   -0.002095314 -0.02582774 0.02163711 -0.03839092 0.03420029
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3410  -0.3105  -0.2377  0.2437
## s.e.  0.3386   0.2487   0.3417  0.2670
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3970.51,  aic = -7931.03
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001441772 0.01852087 0.01273372 99.88799 145.6958 0.7344323
##                      ACF1
## Training set -0.005598235
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3410  -0.3105  -0.2377  0.2437
## s.e.  0.3386   0.2487   0.3417  0.2670
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3970.51,  aic = -7931.03
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001441772 0.01852087 0.01273372 99.88799 145.6958 0.7344323
##                      ACF1
## Training set -0.005598235
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1546   -0.001280204 -0.02501566 0.02245525 -0.03758045 0.03502004
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2035  -0.3061  -0.0983  0.2533
## s.e.  0.4346   0.2263   0.4389  0.2324
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 3973.32,  aic = -7936.63
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001434434 0.01851811 0.01273274 100.5084 145.2633 0.7338826
##                      ACF1
## Training set -0.007879301
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.2035  -0.3061  -0.0983  0.2533
## s.e.  0.4346   0.2263   0.4389  0.2324
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 3973.32,  aic = -7936.63
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001434434 0.01851811 0.01273274 100.5084 145.2633 0.7338826
##                      ACF1
## Training set -0.007879301
## 
## Forecasts:
##      Point Forecast      Lo 80      Hi 80       Lo 95      Hi 95
## 1547    0.002801507 -0.0209304 0.02653341 -0.03349331 0.03909633
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3350  -0.3032  -0.2329  0.2378
## s.e.  0.3438   0.2516   0.3470  0.2691
## 
## sigma^2 estimated as 0.0003432:  log likelihood = 3975.31,  aic = -7940.63
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001428838 0.01852495 0.01274228 99.98143 144.9518 0.7339396
##                     ACF1
## Training set -0.00547146
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3350  -0.3032  -0.2329  0.2378
## s.e.  0.3438   0.2516   0.3470  0.2691
## 
## sigma^2 estimated as 0.0003432:  log likelihood = 3975.31,  aic = -7940.63
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001428838 0.01852495 0.01274228 99.98143 144.9518 0.7339396
##                     ACF1
## Training set -0.00547146
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1548   -0.002263543 -0.02600422 0.02147713 -0.03857177 0.03404468
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3340  -0.3029  -0.2317  0.2375
## s.e.  0.3437   0.2512   0.3468  0.2686
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3978.38,  aic = -7946.76
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426886 0.01851899 0.01273495 99.94292 144.8959 0.7334036
##                      ACF1
## Training set -0.005388152
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3340  -0.3029  -0.2317  0.2375
## s.e.  0.3437   0.2512   0.3468  0.2686
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3978.38,  aic = -7946.76
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426886 0.01851899 0.01273495 99.94292 144.8959 0.7334036
##                      ACF1
## Training set -0.005388152
## 
## Forecasts:
##      Point Forecast      Lo 80      Hi 80       Lo 95      Hi 95
## 1549   6.354664e-05 -0.0236695 0.02379659 -0.03623302 0.03636011
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3436  -0.2917  -0.2414  0.2243
## s.e.  0.3526   0.2516   0.3555  0.2704
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3980.87,  aic = -7951.75
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001440528 0.01851991 0.01273954 99.84719 145.0927 0.7334977
##                      ACF1
## Training set -0.005509256
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3436  -0.2917  -0.2414  0.2243
## s.e.  0.3526   0.2516   0.3555  0.2704
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3980.87,  aic = -7951.75
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001440528 0.01851991 0.01273954 99.84719 145.0927 0.7334977
##                      ACF1
## Training set -0.005509256
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80      Lo 95      Hi 95
## 1550    0.002829266 -0.02090496 0.02656349 -0.0334691 0.03912763
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3443  -0.2907  -0.2422  0.2233
## s.e.  0.3519   0.2534   0.3548  0.2720
## 
## sigma^2 estimated as 0.0003428:  log likelihood = 3983.89,  aic = -7957.77
## 
## Training set error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001435777 0.01851464 0.01273531 99.8913 145.0173 0.7330872
##                      ACF1
## Training set -0.005554807
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3443  -0.2907  -0.2422  0.2233
## s.e.  0.3519   0.2534   0.3548  0.2720
## 
## sigma^2 estimated as 0.0003428:  log likelihood = 3983.89,  aic = -7957.77
## 
## Error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001435777 0.01851464 0.01273531 99.8913 145.0173 0.7330872
##                      ACF1
## Training set -0.005554807
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1551   -0.001050912 -0.02477838 0.02267655 -0.03733894 0.03523711
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3374  -0.2808  -0.2349  0.2126
## s.e.  0.3564   0.2447   0.3595  0.2622
## 
## sigma^2 estimated as 0.0003431:  log likelihood = 3985.71,  aic = -7961.42
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001416291 0.01852353 0.01274574 99.74808 145.0895 0.733431
##                      ACF1
## Training set -0.005585046
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3374  -0.2808  -0.2349  0.2126
## s.e.  0.3564   0.2447   0.3595  0.2622
## 
## sigma^2 estimated as 0.0003431:  log likelihood = 3985.71,  aic = -7961.42
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001416291 0.01852353 0.01274574 99.74808 145.0895 0.733431
##                      ACF1
## Training set -0.005585046
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1552   -0.003725869 -0.02746473 0.02001299 -0.04003132 0.03257958
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3385  -0.2861  -0.2354  0.2178
## s.e.  0.3517   0.2427   0.3548  0.2602
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3988.54,  aic = -7967.07
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001406486 0.01852048 0.01274625 99.76525 145.3913 0.7335631
##                      ACF1
## Training set -0.005390457
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3385  -0.2861  -0.2354  0.2178
## s.e.  0.3517   0.2427   0.3548  0.2602
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3988.54,  aic = -7967.07
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001406486 0.01852048 0.01274625 99.76525 145.3913 0.7335631
##                      ACF1
## Training set -0.005390457
## 
## Forecasts:
##      Point Forecast       Lo 80     Hi 80       Lo 95      Hi 95
## 1553  -0.0003001465 -0.02403509 0.0234348 -0.03659961 0.03599932
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3439  -0.2892  -0.2403  0.2216
## s.e.  0.3520   0.2456   0.3550  0.2635
## 
## sigma^2 estimated as 0.0003431:  log likelihood = 3990.92,  aic = -7971.83
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001389718 0.01852277 0.01275262 100.0076 145.6516 0.7342549
##                     ACF1
## Training set -0.00518322
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3439  -0.2892  -0.2403  0.2216
## s.e.  0.3520   0.2456   0.3550  0.2635
## 
## sigma^2 estimated as 0.0003431:  log likelihood = 3990.92,  aic = -7971.83
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001389718 0.01852277 0.01275262 100.0076 145.6516 0.7342549
##                     ACF1
## Training set -0.00518322
## 
## Forecasts:
##      Point Forecast     Lo 80      Hi 80       Lo 95      Hi 95
## 1554  -0.0004101203 -0.024148 0.02332776 -0.03671408 0.03589384
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3418  -0.3110  -0.2394  0.2436
## s.e.  0.3330   0.2475   0.3362  0.2645
## 
## sigma^2 estimated as 0.0003433:  log likelihood = 3993.11,  aic = -7976.22
## 
## Training set error measures:
##                      ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.00140719 0.01852722 0.01275959 99.72719 145.0486 0.733871
##                     ACF1
## Training set -0.00502779
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3418  -0.3110  -0.2394  0.2436
## s.e.  0.3330   0.2475   0.3362  0.2645
## 
## sigma^2 estimated as 0.0003433:  log likelihood = 3993.11,  aic = -7976.22
## 
## Error measures:
##                      ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.00140719 0.01852722 0.01275959 99.72719 145.0486 0.733871
##                     ACF1
## Training set -0.00502779
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1555    0.003969307 -0.01977428 0.02771289 -0.03234337 0.04028199
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3484  -0.2938  -0.2448  0.2245
## s.e.  0.3400   0.2451   0.3433  0.2628
## 
## sigma^2 estimated as 0.0003432:  log likelihood = 3995.89,  aic = -7981.78
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001415228 0.01852471 0.01276088 99.74786 145.7019 0.7342541
##                      ACF1
## Training set -0.005595217
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3484  -0.2938  -0.2448  0.2245
## s.e.  0.3400   0.2451   0.3433  0.2628
## 
## sigma^2 estimated as 0.0003432:  log likelihood = 3995.89,  aic = -7981.78
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001415228 0.01852471 0.01276088 99.74786 145.7019 0.7342541
##                      ACF1
## Training set -0.005595217
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1556    0.001264959 -0.02247541 0.02500533 -0.03504281 0.03757273
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3510  -0.2934  -0.2473  0.2241
## s.e.  0.3422   0.2439   0.3454  0.2619
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3998.89,  aic = -7987.78
## 
## Training set error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001418382 0.0185196 0.01275735 99.80198 145.8228 0.7342561
##                      ACF1
## Training set -0.005690426
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3510  -0.2934  -0.2473  0.2241
## s.e.  0.3422   0.2439   0.3454  0.2619
## 
## sigma^2 estimated as 0.000343:  log likelihood = 3998.89,  aic = -7987.78
## 
## Error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001418382 0.0185196 0.01275735 99.80198 145.8228 0.7342561
##                      ACF1
## Training set -0.005690426
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1557  -0.0009802688 -0.02471409 0.02275356 -0.03727802 0.03531748
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3444  -0.2799  -0.2401  0.2114
## s.e.  0.3607   0.2427   0.3638  0.2616
## 
## sigma^2 estimated as 0.000343:  log likelihood = 4001.47,  aic = -7992.94
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001426944 0.01851947 0.01276098 99.96821 145.8313 0.734691
##                      ACF1
## Training set -0.005982787
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3444  -0.2799  -0.2401  0.2114
## s.e.  0.3607   0.2427   0.3638  0.2616
## 
## sigma^2 estimated as 0.000343:  log likelihood = 4001.47,  aic = -7992.94
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001426944 0.01851947 0.01276098 99.96821 145.8313 0.734691
##                      ACF1
## Training set -0.005982787
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1558   0.0007475144 -0.02298614 0.02448117 -0.03554998 0.03704501
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##         ar1      ar2      ma1     ma2
##       0.358  -0.2863  -0.2544  0.2166
## s.e.  0.351   0.2448   0.3541  0.2638
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 4004.3,  aic = -7998.6
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001419997 0.01851639 0.01276108 99.90276 145.8453 0.7343671
##                      ACF1
## Training set -0.005864622
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##         ar1      ar2      ma1     ma2
##       0.358  -0.2863  -0.2544  0.2166
## s.e.  0.351   0.2448   0.3541  0.2638
## 
## sigma^2 estimated as 0.0003429:  log likelihood = 4004.3,  aic = -7998.6
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001419997 0.01851639 0.01276108 99.90276 145.8453 0.7343671
##                      ACF1
## Training set -0.005864622
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1559   -0.002091077 -0.02582079 0.02163864 -0.03838254 0.03420039
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1    ma2
##       0.3592  -0.2850  -0.2554  0.215
## s.e.  0.3515   0.2441   0.3546  0.263
## 
## sigma^2 estimated as 0.0003426:  log likelihood = 4007.36,  aic = -8004.73
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001417701 0.01851055 0.01275441 99.87006 145.844 0.7342428
##                      ACF1
## Training set -0.005836903
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1    ma2
##       0.3592  -0.2850  -0.2554  0.215
## s.e.  0.3515   0.2441   0.3546  0.263
## 
## sigma^2 estimated as 0.0003426:  log likelihood = 4007.36,  aic = -8004.73
## 
## Error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001417701 0.01851055 0.01275441 99.87006 145.844 0.7342428
##                      ACF1
## Training set -0.005836903
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95    Hi 95
## 1560  -0.0002890042 -0.02401123 0.02343322 -0.03656901 0.035991
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3568  -0.2835  -0.2532  0.2135
## s.e.  0.3464   0.2452   0.3496  0.2632
## 
## sigma^2 estimated as 0.0003426:  log likelihood = 4010.12,  aic = -8010.24
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426463 0.01850832 0.01275546 99.81778 145.7173 0.7342662
##                      ACF1
## Training set -0.005820756
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3568  -0.2835  -0.2532  0.2135
## s.e.  0.3464   0.2452   0.3496  0.2632
## 
## sigma^2 estimated as 0.0003426:  log likelihood = 4010.12,  aic = -8010.24
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426463 0.01850832 0.01275546 99.81778 145.7173 0.7342662
##                      ACF1
## Training set -0.005820756
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1561    0.002170725 -0.02154865 0.02589009 -0.03410492 0.03844637
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3568  -0.2831  -0.2533  0.2131
## s.e.  0.3476   0.2459   0.3507  0.2642
## 
## sigma^2 estimated as 0.0003423:  log likelihood = 4013.17,  aic = -8016.34
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001423014 0.01850267 0.01274982 99.89774 145.7068 0.7339737
##                      ACF1
## Training set -0.005844969
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3568  -0.2831  -0.2533  0.2131
## s.e.  0.3476   0.2459   0.3507  0.2642
## 
## sigma^2 estimated as 0.0003423:  log likelihood = 4013.17,  aic = -8016.34
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001423014 0.01850267 0.01274982 99.89774 145.7068 0.7339737
##                      ACF1
## Training set -0.005844969
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1562   -0.000583117 -0.02429525 0.02312901 -0.03684769 0.03568145
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3502  -0.2796  -0.2465  0.2098
## s.e.  0.3500   0.2452   0.3531  0.2634
## 
## sigma^2 estimated as 0.0003423:  log likelihood = 4015.94,  aic = -8021.88
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001412672 0.01850028 0.01275066 99.84133 145.6333 0.7341405
##                     ACF1
## Training set -0.00588337
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3502  -0.2796  -0.2465  0.2098
## s.e.  0.3500   0.2452   0.3531  0.2634
## 
## sigma^2 estimated as 0.0003423:  log likelihood = 4015.94,  aic = -8021.88
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001412672 0.01850028 0.01275066 99.84133 145.6333 0.7341405
##                     ACF1
## Training set -0.00588337
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1563   -0.002013532 -0.02572259 0.02169553 -0.03827341 0.03424635
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3510  -0.2797  -0.2473  0.2098
## s.e.  0.3494   0.2451   0.3525  0.2633
## 
## sigma^2 estimated as 0.000342:  log likelihood = 4019.01,  aic = -8028.02
## 
## Training set error measures:
##                       ME       RMSE      MAE     MPE     MAPE      MASE
## Training set 0.001411342 0.01849437 0.012743 99.7971 145.5764 0.7338431
##                      ACF1
## Training set -0.005823643
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3510  -0.2797  -0.2473  0.2098
## s.e.  0.3494   0.2451   0.3525  0.2633
## 
## sigma^2 estimated as 0.000342:  log likelihood = 4019.01,  aic = -8028.02
## 
## Error measures:
##                       ME       RMSE      MAE     MPE     MAPE      MASE
## Training set 0.001411342 0.01849437 0.012743 99.7971 145.5764 0.7338431
##                      ACF1
## Training set -0.005823643
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80      Lo 95      Hi 95
## 1564   0.0003770919 -0.02332439 0.02407858 -0.0358712 0.03662539
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3486  -0.2777  -0.2449  0.2076
## s.e.  0.3508   0.2435   0.3540  0.2618
## 
## sigma^2 estimated as 0.0003419:  log likelihood = 4021.8,  aic = -8033.6
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001419652 0.01849181 0.01274363 99.73078 145.502 0.7338873
##                      ACF1
## Training set -0.005874706
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3486  -0.2777  -0.2449  0.2076
## s.e.  0.3508   0.2435   0.3540  0.2618
## 
## sigma^2 estimated as 0.0003419:  log likelihood = 4021.8,  aic = -8033.6
## 
## Error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001419652 0.01849181 0.01274363 99.73078 145.502 0.7338873
##                      ACF1
## Training set -0.005874706
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1565    0.002188571 -0.02150964 0.02588678 -0.03405471 0.03843185
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3501  -0.2860  -0.2461  0.2159
## s.e.  0.3440   0.2439   0.3471  0.2623
## 
## sigma^2 estimated as 0.0003419:  log likelihood = 4024.43,  aic = -8038.85
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001429831 0.01849115 0.01274689 99.72377 145.6898 0.7343989
##                      ACF1
## Training set -0.005843077
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3501  -0.2860  -0.2461  0.2159
## s.e.  0.3440   0.2439   0.3471  0.2623
## 
## sigma^2 estimated as 0.0003419:  log likelihood = 4024.43,  aic = -8038.85
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001429831 0.01849115 0.01274689 99.72377 145.6898 0.7343989
##                      ACF1
## Training set -0.005843077
## 
## Forecasts:
##      Point Forecast       Lo 80     Hi 80       Lo 95      Hi 95
## 1566    0.001508138 -0.02218923 0.0252055 -0.03473385 0.03775013
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3464  -0.2856  -0.2427  0.2155
## s.e.  0.3447   0.2433   0.3479  0.2616
## 
## sigma^2 estimated as 0.0003418:  log likelihood = 4027.25,  aic = -8044.5
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001421241 0.01848817 0.01274676 99.64546 145.4055 0.7340179
##                      ACF1
## Training set -0.005874378
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3464  -0.2856  -0.2427  0.2155
## s.e.  0.3447   0.2433   0.3479  0.2616
## 
## sigma^2 estimated as 0.0003418:  log likelihood = 4027.25,  aic = -8044.5
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001421241 0.01848817 0.01274676 99.64546 145.4055 0.7340179
##                      ACF1
## Training set -0.005874378
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1567   -0.002684923 -0.02637847 0.02100862 -0.03892107 0.03355123
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3490  -0.2905  -0.2451  0.2198
## s.e.  0.3378   0.2437   0.3410  0.2621
## 
## sigma^2 estimated as 0.0003417:  log likelihood = 4030.08,  aic = -8050.15
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001412798 0.01848517 0.01274699 99.55817 145.5523 0.7343873
##                      ACF1
## Training set -0.005701744
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3490  -0.2905  -0.2451  0.2198
## s.e.  0.3378   0.2437   0.3410  0.2621
## 
## sigma^2 estimated as 0.0003417:  log likelihood = 4030.08,  aic = -8050.15
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001412798 0.01848517 0.01274699 99.55817 145.5523 0.7343873
##                      ACF1
## Training set -0.005701744
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1568   -0.001808345 -0.02549804 0.02188135 -0.03803861 0.03442192
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3552  -0.2957  -0.2511  0.2248
## s.e.  0.3329   0.2445   0.3360  0.2630
## 
## sigma^2 estimated as 0.0003416:  log likelihood = 4032.95,  aic = -8055.89
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001404433 0.01848167 0.01274664 99.59114 145.7494 0.7347811
##                      ACF1
## Training set -0.005545206
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3552  -0.2957  -0.2511  0.2248
## s.e.  0.3329   0.2445   0.3360  0.2630
## 
## sigma^2 estimated as 0.0003416:  log likelihood = 4032.95,  aic = -8055.89
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001404433 0.01848167 0.01274664 99.59114 145.7494 0.7347811
##                      ACF1
## Training set -0.005545206
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1569   -0.000157118 -0.02384233 0.02352809 -0.03638052 0.03606629
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3541  -0.3018  -0.2503  0.2309
## s.e.  0.3269   0.2453   0.3300  0.2636
## 
## sigma^2 estimated as 0.0003414:  log likelihood = 4035.84,  aic = -8061.69
## 
## Training set error measures:
##                      ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.00141134 0.01847782 0.01274527 99.49412 145.5466 0.7345113
##                      ACF1
## Training set -0.005437234
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3541  -0.3018  -0.2503  0.2309
## s.e.  0.3269   0.2453   0.3300  0.2636
## 
## sigma^2 estimated as 0.0003414:  log likelihood = 4035.84,  aic = -8061.69
## 
## Error measures:
##                      ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.00141134 0.01847782 0.01274527 99.49412 145.5466 0.7345113
##                      ACF1
## Training set -0.005437234
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1570    0.002477296 -0.02120299 0.02615758 -0.03373857 0.03869316
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3538  -0.3016  -0.2500  0.2307
## s.e.  0.3271   0.2451   0.3303  0.2634
## 
## sigma^2 estimated as 0.0003412:  log likelihood = 4038.92,  aic = -8067.83
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001409984 0.01847195 0.01273756 99.41118 145.4649 0.7342937
##                      ACF1
## Training set -0.005466099
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3538  -0.3016  -0.2500  0.2307
## s.e.  0.3271   0.2451   0.3303  0.2634
## 
## sigma^2 estimated as 0.0003412:  log likelihood = 4038.92,  aic = -8067.83
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001409984 0.01847195 0.01273756 99.41118 145.4649 0.7342937
##                      ACF1
## Training set -0.005466099
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1571   7.571212e-05 -0.02359704 0.02374846 -0.03612864 0.03628006
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3589  -0.3022  -0.2552  0.2310
## s.e.  0.3265   0.2449   0.3297  0.2634
## 
## sigma^2 estimated as 0.0003411:  log likelihood = 4041.86,  aic = -8073.72
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001415242 0.01846754 0.01273546 99.43807 145.5439 0.7344377
##                      ACF1
## Training set -0.005487437
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3589  -0.3022  -0.2552  0.2310
## s.e.  0.3265   0.2449   0.3297  0.2634
## 
## sigma^2 estimated as 0.0003411:  log likelihood = 4041.86,  aic = -8073.72
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001415242 0.01846754 0.01273546 99.43807 145.5439 0.7344377
##                      ACF1
## Training set -0.005487437
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1572   0.0002887444 -0.02337837 0.02395585 -0.03590698 0.03648447
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3584  -0.2911  -0.2542  0.2196
## s.e.  0.3379   0.2420   0.3410  0.2609
## 
## sigma^2 estimated as 0.000341:  log likelihood = 4044.52,  aic = -8079.03
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001424239 0.01846659 0.01273825 99.51764 145.7167 0.7348551
##                      ACF1
## Training set -0.005743757
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3584  -0.2911  -0.2542  0.2196
## s.e.  0.3379   0.2420   0.3410  0.2609
## 
## sigma^2 estimated as 0.000341:  log likelihood = 4044.52,  aic = -8079.03
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001424239 0.01846659 0.01273825 99.51764 145.7167 0.7348551
##                      ACF1
## Training set -0.005743757
## 
## Forecasts:
##      Point Forecast       Lo 80     Hi 80       Lo 95      Hi 95
## 1573    0.001185614 -0.02248027 0.0248515 -0.03500823 0.03737946
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3522  -0.2887  -0.2475  0.2177
## s.e.  0.3432   0.2403   0.3462  0.2595
## 
## sigma^2 estimated as 0.0003409:  log likelihood = 4047.33,  aic = -8084.65
## 
## Training set error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001430423 0.0184638 0.01273877 99.57158 145.7743 0.7352825
##                     ACF1
## Training set -0.00589391
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3522  -0.2887  -0.2475  0.2177
## s.e.  0.3432   0.2403   0.3462  0.2595
## 
## sigma^2 estimated as 0.0003409:  log likelihood = 4047.33,  aic = -8084.65
## 
## Error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001430423 0.0184638 0.01273877 99.57158 145.7743 0.7352825
##                     ACF1
## Training set -0.00589391
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95     Hi 95
## 1574   0.0005314097 -0.02313091 0.02419372 -0.03565698 0.0367198
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3468  -0.2907  -0.2417  0.2210
## s.e.  0.3432   0.2415   0.3462  0.2608
## 
## sigma^2 estimated as 0.0003409:  log likelihood = 4049.98,  aic = -8089.96
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001438515 0.01846288 0.01274163 99.68675 145.7803 0.7358361
##                      ACF1
## Training set -0.005896909
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3468  -0.2907  -0.2417  0.2210
## s.e.  0.3432   0.2415   0.3462  0.2608
## 
## sigma^2 estimated as 0.0003409:  log likelihood = 4049.98,  aic = -8089.96
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001438515 0.01846288 0.01274163 99.68675 145.7803 0.7358361
##                      ACF1
## Training set -0.005896909
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1575   0.0006872809 -0.02297386 0.02434842 -0.03549931 0.03687387
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3464  -0.2904  -0.2413  0.2207
## s.e.  0.3432   0.2414   0.3462  0.2607
## 
## sigma^2 estimated as 0.0003407:  log likelihood = 4053.05,  aic = -8096.1
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001438326 0.01845705 0.01273442 99.67543 145.7419 0.7354704
##                      ACF1
## Training set -0.005942696
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3464  -0.2904  -0.2413  0.2207
## s.e.  0.3432   0.2414   0.3462  0.2607
## 
## sigma^2 estimated as 0.0003407:  log likelihood = 4053.05,  aic = -8096.1
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001438326 0.01845705 0.01273442 99.67543 145.7419 0.7354704
##                      ACF1
## Training set -0.005942696
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95     Hi 95
## 1576  -0.0009602613 -0.02461393 0.02269341 -0.03713542 0.0352149
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3365  -0.2868  -0.2312  0.2186
## s.e.  0.3469   0.2390   0.3500  0.2570
## 
## sigma^2 estimated as 0.0003408:  log likelihood = 4055.41,  aic = -8100.83
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001449269 0.01845948 0.01274023 99.80221 145.5329 0.7357619
##                      ACF1
## Training set -0.006049279
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3365  -0.2868  -0.2312  0.2186
## s.e.  0.3469   0.2390   0.3500  0.2570
## 
## sigma^2 estimated as 0.0003408:  log likelihood = 4055.41,  aic = -8100.83
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001449269 0.01845948 0.01274023 99.80221 145.5329 0.7357619
##                      ACF1
## Training set -0.006049279
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1577    0.001696167 -0.02196061 0.02535295 -0.03448376 0.03787609
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3377  -0.2877  -0.2326  0.2194
## s.e.  0.3461   0.2394   0.3492  0.2575
## 
## sigma^2 estimated as 0.0003405:  log likelihood = 4058.48,  aic = -8106.96
## 
## Training set error measures:
##                      ME       RMSE       MAE     MPE     MAPE      MASE
## Training set 0.00144696 0.01845375 0.0127338 99.9059 145.5905 0.7352664
##                      ACF1
## Training set -0.006089293
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3377  -0.2877  -0.2326  0.2194
## s.e.  0.3461   0.2394   0.3492  0.2575
## 
## sigma^2 estimated as 0.0003405:  log likelihood = 4058.48,  aic = -8106.96
## 
## Error measures:
##                      ME       RMSE       MAE     MPE     MAPE      MASE
## Training set 0.00144696 0.01845375 0.0127338 99.9059 145.5905 0.7352664
##                      ACF1
## Training set -0.006089293
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1578  -0.0009322146 -0.02458164 0.02271721 -0.03710089 0.03523646
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3346  -0.2934  -0.2296  0.2263
## s.e.  0.3423   0.2399   0.3454  0.2574
## 
## sigma^2 estimated as 0.0003406:  log likelihood = 4060.98,  aic = -8111.97
## 
## Training set error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001457578 0.01845453 0.01273821 99.9986 145.3978 0.7354571
##                      ACF1
## Training set -0.006026158
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3346  -0.2934  -0.2296  0.2263
## s.e.  0.3423   0.2399   0.3454  0.2574
## 
## sigma^2 estimated as 0.0003406:  log likelihood = 4060.98,  aic = -8111.97
## 
## Error measures:
##                       ME       RMSE        MAE     MPE     MAPE      MASE
## Training set 0.001457578 0.01845453 0.01273821 99.9986 145.3978 0.7354571
##                      ACF1
## Training set -0.006026158
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1579     0.00143986 -0.02221057 0.02509029 -0.03473036 0.03761008
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3304  -0.2884  -0.2250  0.2215
## s.e.  0.3445   0.2383   0.3477  0.2553
## 
## sigma^2 estimated as 0.0003404:  log likelihood = 4063.85,  aic = -8117.71
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001463069 0.01845107 0.01273766 100.0329 145.4919 0.7357423
##                      ACF1
## Training set -0.006139675
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3304  -0.2884  -0.2250  0.2215
## s.e.  0.3445   0.2383   0.3477  0.2553
## 
## sigma^2 estimated as 0.0003404:  log likelihood = 4063.85,  aic = -8117.71
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001463069 0.01845107 0.01273766 100.0329 145.4919 0.7357423
##                      ACF1
## Training set -0.006139675
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80      Lo 95      Hi 95
## 1580    0.000665633 -0.02298036 0.02431163 -0.0354978 0.03682907
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3367  -0.2879  -0.2317  0.2199
## s.e.  0.3432   0.2416   0.3463  0.2593
## 
## sigma^2 estimated as 0.0003405:  log likelihood = 4066.26,  aic = -8122.51
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001450613 0.01845306 0.01274294 99.90457 145.3775 0.7356007
##                      ACF1
## Training set -0.006094123
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3367  -0.2879  -0.2317  0.2199
## s.e.  0.3432   0.2416   0.3463  0.2593
## 
## sigma^2 estimated as 0.0003405:  log likelihood = 4066.26,  aic = -8122.51
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001450613 0.01845306 0.01274294 99.90457 145.3775 0.7356007
##                      ACF1
## Training set -0.006094123
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1581   -0.003239006 -0.02688756 0.02040954 -0.03940634 0.03292833
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3356  -0.2880  -0.2312  0.2204
## s.e.  0.3435   0.2434   0.3466  0.2610
## 
## sigma^2 estimated as 0.0003404:  log likelihood = 4069.15,  aic = -8128.31
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001456722 0.01844931 0.01274169 99.94739 145.1253 0.7352278
##                      ACF1
## Training set -0.006036143
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3356  -0.2880  -0.2312  0.2204
## s.e.  0.3435   0.2434   0.3466  0.2610
## 
## sigma^2 estimated as 0.0003404:  log likelihood = 4069.15,  aic = -8128.31
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001456722 0.01844931 0.01274169 99.94739 145.1253 0.7352278
##                      ACF1
## Training set -0.006036143
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1582    0.001326101 -0.02231764 0.02496984 -0.03483388 0.03748608
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3360  -0.2880  -0.2315  0.2204
## s.e.  0.3434   0.2433   0.3465  0.2609
## 
## sigma^2 estimated as 0.0003402:  log likelihood = 4072.23,  aic = -8134.45
## 
## Training set error measures:
##                       ME       RMSE       MAE      MPE     MAPE      MASE
## Training set 0.001455659 0.01844348 0.0127338 99.87112 145.0523 0.7350574
##                      ACF1
## Training set -0.006060042
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3360  -0.2880  -0.2315  0.2204
## s.e.  0.3434   0.2433   0.3465  0.2609
## 
## sigma^2 estimated as 0.0003402:  log likelihood = 4072.23,  aic = -8134.45
## 
## Error measures:
##                       ME       RMSE       MAE      MPE     MAPE      MASE
## Training set 0.001455659 0.01844348 0.0127338 99.87112 145.0523 0.7350574
##                      ACF1
## Training set -0.006060042
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1583   0.0006025782 -0.02303369 0.02423884 -0.03554597 0.03675113
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3361  -0.2884  -0.2316  0.2208
## s.e.  0.3429   0.2431   0.3460  0.2606
## 
## sigma^2 estimated as 0.0003399:  log likelihood = 4075.3,  aic = -8140.6
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001455232 0.01843766 0.01272623 99.84296 144.9957 0.7350777
##                      ACF1
## Training set -0.006052488
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3361  -0.2884  -0.2316  0.2208
## s.e.  0.3429   0.2431   0.3460  0.2606
## 
## sigma^2 estimated as 0.0003399:  log likelihood = 4075.3,  aic = -8140.6
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001455232 0.01843766 0.01272623 99.84296 144.9957 0.7350777
##                      ACF1
## Training set -0.006052488
## 
## Forecasts:
##      Point Forecast      Lo 80      Hi 80       Lo 95      Hi 95
## 1584  -8.278886e-05 -0.0237116 0.02354602 -0.03621994 0.03605436
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3391  -0.3079  -0.2351  0.2407
## s.e.  0.3335   0.2453   0.3365  0.2635
## 
## sigma^2 estimated as 0.0003398:  log likelihood = 4078.12,  aic = -8146.24
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001446991 0.01843478 0.01272644 99.77431 144.8273 0.7351627
##                      ACF1
## Training set -0.005590442
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3391  -0.3079  -0.2351  0.2407
## s.e.  0.3335   0.2453   0.3365  0.2635
## 
## sigma^2 estimated as 0.0003398:  log likelihood = 4078.12,  aic = -8146.24
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001446991 0.01843478 0.01272644 99.77431 144.8273 0.7351627
##                      ACF1
## Training set -0.005590442
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1585   -0.001647186 -0.02527231 0.02197794 -0.03777869 0.03448432
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3318  -0.2894  -0.2273  0.2222
## s.e.  0.3433   0.2414   0.3464  0.2588
## 
## sigma^2 estimated as 0.0003396:  log likelihood = 4081.19,  aic = -8152.38
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001443504 0.01842905 0.01271972 99.80101 144.8539 0.7349824
##                      ACF1
## Training set -0.005990802
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3318  -0.2894  -0.2273  0.2222
## s.e.  0.3433   0.2414   0.3464  0.2588
## 
## sigma^2 estimated as 0.0003396:  log likelihood = 4081.19,  aic = -8152.38
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001443504 0.01842905 0.01271972 99.80101 144.8539 0.7349824
##                      ACF1
## Training set -0.005990802
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1586   0.0001538969 -0.02346389 0.02377168 -0.03596638 0.03627418
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3321  -0.2894  -0.2276  0.2222
## s.e.  0.3432   0.2414   0.3463  0.2588
## 
## sigma^2 estimated as 0.0003394:  log likelihood = 4084.26,  aic = -8158.53
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001442042 0.01842326 0.01271225 99.81836 144.8456 0.7349352
##                      ACF1
## Training set -0.005976674
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3321  -0.2894  -0.2276  0.2222
## s.e.  0.3432   0.2414   0.3463  0.2588
## 
## sigma^2 estimated as 0.0003394:  log likelihood = 4084.26,  aic = -8158.53
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001442042 0.01842326 0.01271225 99.81836 144.8456 0.7349352
##                      ACF1
## Training set -0.005976674
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1587   0.0005697673 -0.02304058 0.02418012 -0.03553915 0.03667868
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3320  -0.2901  -0.2275  0.2229
## s.e.  0.3426   0.2413   0.3457  0.2587
## 
## sigma^2 estimated as 0.0003392:  log likelihood = 4087.33,  aic = -8164.67
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001442131 0.01841749 0.01270522 99.79971 144.7931 0.7349159
##                      ACF1
## Training set -0.005965339
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3320  -0.2901  -0.2275  0.2229
## s.e.  0.3426   0.2413   0.3457  0.2587
## 
## sigma^2 estimated as 0.0003392:  log likelihood = 4087.33,  aic = -8164.67
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001442131 0.01841749 0.01270522 99.79971 144.7931 0.7349159
##                      ACF1
## Training set -0.005965339
## 
## Forecasts:
##      Point Forecast      Lo 80      Hi 80       Lo 95      Hi 95
## 1588   0.0003666669 -0.0232363 0.02396963 -0.03573095 0.03646428
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3338  -0.2906  -0.2293  0.2232
## s.e.  0.3415   0.2417   0.3446  0.2592
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4090.35,  aic = -8170.7
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001445418 0.01841239 0.01270128 99.79533 144.8023 0.7350268
##                      ACF1
## Training set -0.005969215
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3338  -0.2906  -0.2293  0.2232
## s.e.  0.3415   0.2417   0.3446  0.2592
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4090.35,  aic = -8170.7
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001445418 0.01841239 0.01270128 99.79533 144.8023 0.7350268
##                      ACF1
## Training set -0.005969215
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1589   0.0005193535 -0.02307707 0.02411578 -0.03556826 0.03660697
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3342  -0.2857  -0.2294  0.2181
## s.e.  0.3466   0.2397   0.3497  0.2574
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4092.87,  aic = -8175.74
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001456194 0.01841305 0.01270563 99.83401 144.9301 0.735389
##                      ACF1
## Training set -0.006135375
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3342  -0.2857  -0.2294  0.2181
## s.e.  0.3466   0.2397   0.3497  0.2574
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4092.87,  aic = -8175.74
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE     MASE
## Training set 0.001456194 0.01841305 0.01270563 99.83401 144.9301 0.735389
##                      ACF1
## Training set -0.006135375
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80      Lo 95      Hi 95
## 1590    0.001673608 -0.02192366 0.02527088 -0.0344153 0.03776251
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3316  -0.2846  -0.2265  0.2173
## s.e.  0.3487   0.2384   0.3518  0.2561
## 
## sigma^2 estimated as 0.0003389:  log likelihood = 4095.89,  aic = -8181.77
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001458507 0.01840793 0.01270164 99.85441 144.9542 0.7352984
##                      ACF1
## Training set -0.006231067
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3316  -0.2846  -0.2265  0.2173
## s.e.  0.3487   0.2384   0.3518  0.2561
## 
## sigma^2 estimated as 0.0003389:  log likelihood = 4095.89,  aic = -8181.77
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001458507 0.01840793 0.01270164 99.85441 144.9542 0.7352984
##                      ACF1
## Training set -0.006231067
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95     Hi 95
## 1591   -0.000244168 -0.02383487 0.02334654 -0.03632304 0.0358347
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3310  -0.2845  -0.2258  0.2174
## s.e.  0.3491   0.2385   0.3522  0.2561
## 
## sigma^2 estimated as 0.0003386:  log likelihood = 4098.95,  aic = -8187.9
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001459303 0.01840231 0.01269566 99.88108 144.9314 0.7352808
##                     ACF1
## Training set -0.00625168
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3310  -0.2845  -0.2258  0.2174
## s.e.  0.3491   0.2385   0.3522  0.2561
## 
## sigma^2 estimated as 0.0003386:  log likelihood = 4098.95,  aic = -8187.9
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001459303 0.01840231 0.01269566 99.88108 144.9314 0.7352808
##                     ACF1
## Training set -0.00625168
## 
## Forecasts:
##      Point Forecast       Lo 80     Hi 80       Lo 95      Hi 95
## 1592  -0.0006447112 -0.02422822 0.0229388 -0.03671258 0.03542315
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3271  -0.2817  -0.2219  0.2151
## s.e.  0.3517   0.2381   0.3547  0.2555
## 
## sigma^2 estimated as 0.0003385:  log likelihood = 4101.91,  aic = -8193.83
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001463084 0.01839781 0.01269307 99.92036 144.862 0.7354581
##                      ACF1
## Training set -0.006309886
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3271  -0.2817  -0.2219  0.2151
## s.e.  0.3517   0.2381   0.3547  0.2555
## 
## sigma^2 estimated as 0.0003385:  log likelihood = 4101.91,  aic = -8193.83
## 
## Error measures:
##                       ME       RMSE        MAE      MPE    MAPE      MASE
## Training set 0.001463084 0.01839781 0.01269307 99.92036 144.862 0.7354581
##                      ACF1
## Training set -0.006309886
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1593   0.0005544239 -0.02302332 0.02413217 -0.03550462 0.03661347
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3390  -0.2852  -0.2343  0.2174
## s.e.  0.3497   0.2416   0.3527  0.2601
## 
## sigma^2 estimated as 0.0003387:  log likelihood = 4103.93,  aic = -8197.86
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001447186 0.01840428 0.01270193 99.87159 144.8502 0.7355165
##                      ACF1
## Training set -0.006193087
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3390  -0.2852  -0.2343  0.2174
## s.e.  0.3497   0.2416   0.3527  0.2601
## 
## sigma^2 estimated as 0.0003387:  log likelihood = 4103.93,  aic = -8197.86
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001447186 0.01840428 0.01270193 99.87159 144.8502 0.7355165
##                      ACF1
## Training set -0.006193087
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1594   -0.003024574 -0.02661061 0.02056147 -0.03909631 0.03304716
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3376  -0.2741  -0.2313  0.2054
## s.e.  0.3603   0.2370   0.3631  0.2563
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4105.91,  aic = -8201.82
## 
## Training set error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001427669 0.01841117 0.01271151 99.90071 145.5109 0.7364265
##                      ACF1
## Training set -0.006239062
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3376  -0.2741  -0.2313  0.2054
## s.e.  0.3603   0.2370   0.3631  0.2563
## 
## sigma^2 estimated as 0.000339:  log likelihood = 4105.91,  aic = -8201.82
## 
## Error measures:
##                       ME       RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001427669 0.01841117 0.01271151 99.90071 145.5109 0.7364265
##                      ACF1
## Training set -0.006239062
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1595   -0.002238523 -0.02583339 0.02135634 -0.03832375 0.03384671
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3374  -0.2741  -0.2310  0.2054
## s.e.  0.3602   0.2369   0.3631  0.2562
## 
## sigma^2 estimated as 0.0003388:  log likelihood = 4108.99,  aic = -8207.97
## 
## Training set error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426645 0.0184054 0.01270363 99.84314 145.4239 0.7356856
##                      ACF1
## Training set -0.006166497
## 
## Forecast method: ARIMA(2,0,2) with zero mean
## 
## Model Information:
## 
## Call:
## arima(x = dlogprice_training, order = c(2, 0, 2), include.mean = FALSE)
## 
## Coefficients:
##          ar1      ar2      ma1     ma2
##       0.3374  -0.2741  -0.2310  0.2054
## s.e.  0.3602   0.2369   0.3631  0.2562
## 
## sigma^2 estimated as 0.0003388:  log likelihood = 4108.99,  aic = -8207.97
## 
## Error measures:
##                       ME      RMSE        MAE      MPE     MAPE      MASE
## Training set 0.001426645 0.0184054 0.01270363 99.84314 145.4239 0.7356856
##                      ACF1
## Training set -0.006166497
## 
## Forecasts:
##      Point Forecast       Lo 80      Hi 80      Lo 95      Hi 95
## 1596    0.001942324 -0.02164514 0.02552979 -0.0341316 0.03801624
plot(arima.forecast)

#Visualizing and validating model results

realreturn = realreturn[-1]

forecastreturn = xts(forecastreturn, index(realreturn))
plot(realreturn,type = 'l',main = 'Actual Returns(black) vs Forecast Returns(red)')

lines(forecastreturn ,lwd = 2, col = 'red')

comparison = merge(realreturn,forecastreturn)
comparison
##               realreturn    Forecasted
## 2021-02-19 -0.0086476863  1.080032e-04
## 2021-02-22 -0.0229021775 -1.098070e-03
## 2021-02-23 -0.0251087778 -2.095314e-03
## 2021-02-24  0.0102203454 -1.280204e-03
## 2021-02-25 -0.0251489405  2.801507e-03
## 2021-02-26 -0.0036355145 -2.263543e-03
## 2021-03-01  0.0199821275  6.354664e-05
## 2021-03-02 -0.0035148555  2.829266e-03
## 2021-03-03 -0.0302944238 -1.050912e-03
## 2021-03-04 -0.0166894380 -3.725869e-03
## 2021-03-05 -0.0221173374 -3.001465e-04
## 2021-03-08  0.0241117035 -4.101203e-04
## 2021-03-09  0.0180782914  3.969307e-03
## 2021-03-10  0.0082516863  1.264959e-03
## 2021-03-11  0.0173012842 -9.802688e-04
## 2021-03-12 -0.0122153301  7.475144e-04
## 2021-03-15 -0.0044129116 -2.091077e-03
## 2021-03-16  0.0143323920 -2.890042e-04
## 2021-03-17 -0.0018353609  2.170725e-03
## 2021-03-18 -0.0148381193 -5.831170e-04
## 2021-03-19 -0.0027708160 -2.013532e-03
## 2021-03-22  0.0142909962  3.770919e-04
## 2021-03-23  0.0196741603  2.188571e-03
## 2021-03-24 -0.0115051852  1.508138e-03
## 2021-03-25 -0.0156839989 -2.684923e-03
## 2021-03-26 -0.0136381822 -1.808345e-03
## 2021-03-29  0.0107728556 -1.571180e-04
## 2021-03-30  0.0018309596  2.477296e-03
## 2021-03-31  0.0093496949  7.571212e-05
## 2021-04-01  0.0171741415  2.887444e-04
## 2021-04-05  0.0145586351  1.185614e-03
## 2021-04-06  0.0174973417  5.314097e-04
## 2021-04-07  0.0020525333  6.872809e-04
## 2021-04-08  0.0209810553 -9.602613e-04
## 2021-04-09 -0.0009421502  1.696167e-03
## 2021-04-12  0.0187504087 -9.322146e-04
## 2021-04-13  0.0131857351  1.439860e-03
## 2021-04-14 -0.0207188956  6.656330e-04
## 2021-04-15  0.0077868018 -3.239006e-03
## 2021-04-16  0.0010704555  1.326101e-03
## 2021-04-19  0.0013609276  6.025782e-04
## 2021-04-20 -0.0132293284 -8.278886e-05
## 2021-04-21 -0.0036828715 -1.647186e-03
## 2021-04-22 -0.0007146147  1.538969e-04
## 2021-04-23  0.0021331634  5.697673e-04
## 2021-04-26  0.0067596143  3.666669e-04
## 2021-04-27  0.0199354404  5.193535e-04
## 2021-04-28  0.0079115026  1.673608e-03
## 2021-04-29  0.0029154540 -2.441680e-04
## 2021-04-30  0.0079739458 -6.447112e-04
## 2021-05-03 -0.0262772755  5.544239e-04
## 2021-05-04 -0.0302724828 -3.024574e-03
## 2021-05-05 -0.0023773553 -2.238523e-03
## 2021-05-06 -0.0052706865  1.942324e-03
comparison$Accuracy = sign(comparison$realreturn)==sign(comparison$Forecasted)

Accuracy_percentage = sum(comparison$Accuracy == 1)*100/length(comparison$Accuracy)
Accuracy_percentage
## [1] 61.11111