1. Load наборы данных с rolling-origin
library(tidyverse)
bitcoin_ts <- read_csv("D:/01_Projects/bitcoin/bitcoin_ts.csv")
bitcoin_fc <- read_csv("D:/01_Projects/bitcoin/bitcoin_fc.csv")
knitr::kable(head(bitcoin_ts))
bitcoin_daily |
134.21 |
2013-04-28 |
bitcoin_daily |
144.54 |
2013-04-29 |
bitcoin_daily |
139.00 |
2013-04-30 |
bitcoin_daily |
116.99 |
2013-05-01 |
bitcoin_daily |
105.21 |
2013-05-02 |
bitcoin_daily |
97.75 |
2013-05-03 |
knitr::kable(head(bitcoin_fc))
bitcoin_daily |
auto.arima |
2019-01-02 |
2019-01-01 |
3877.802 |
1 |
3720.308 |
4035.296 |
3681.282 |
4074.321 |
3635.794 |
4119.810 |
3578.558 |
4177.045 |
3493.727 |
4261.876 |
3420.149 |
4335.455 |
3276.344 |
4479.260 |
bitcoin_daily |
auto.arima |
2019-01-03 |
2019-01-01 |
3855.451 |
2 |
3623.826 |
4087.076 |
3566.431 |
4144.471 |
3499.531 |
4211.371 |
3415.356 |
4295.546 |
3290.595 |
4420.307 |
3182.383 |
4528.519 |
2970.890 |
4740.012 |
bitcoin_daily |
auto.arima |
2019-01-04 |
2019-01-01 |
3870.023 |
3 |
3587.487 |
4152.559 |
3517.477 |
4222.569 |
3435.873 |
4304.173 |
3333.196 |
4406.850 |
3181.012 |
4559.034 |
3049.016 |
4691.030 |
2791.037 |
4949.009 |
bitcoin_daily |
auto.arima |
2019-01-05 |
2019-01-01 |
3860.522 |
4 |
3532.302 |
4188.743 |
3450.972 |
4270.073 |
3356.172 |
4364.872 |
3236.893 |
4484.152 |
3060.103 |
4660.942 |
2906.763 |
4814.282 |
2607.070 |
5113.974 |
bitcoin_daily |
auto.arima |
2019-01-06 |
2019-01-01 |
3866.717 |
5 |
3499.975 |
4233.458 |
3409.100 |
4324.333 |
3303.174 |
4430.259 |
3169.896 |
4563.537 |
2972.357 |
4761.077 |
2801.021 |
4932.412 |
2466.155 |
5267.278 |
bitcoin_daily |
auto.arima |
2019-01-07 |
2019-01-01 |
3862.678 |
6 |
3460.179 |
4265.177 |
3360.444 |
4364.912 |
3244.191 |
4481.165 |
3097.918 |
4627.439 |
2881.119 |
4844.237 |
2693.078 |
5032.278 |
2325.563 |
5399.793 |
2. Построить coverage diagram
2.1 для auto.arima
library(forvision)
bitcoin_af <- createAFTS(bitcoin_ts, bitcoin_fc)
plotCoverage(bitcoin_af, pi = 70, methods = "auto.arima", horizons = 1:9)

plotCoverage(bitcoin_af, pi = 90, methods = "auto.arima", horizons = 10:19)

2.2 для auto.ets
plotCoverage(bitcoin_af, pi = 70, methods = "auto.ets", horizons = 1:9)
## Warning in horizon == horizons: longer object length is not a multiple of
## shorter object length

plotCoverage(bitcoin_af, pi = 90, methods = "auto.ets", horizons = 10:19)

2.3 для naive
plotCoverage(bitcoin_af, pi = 70, methods = "naive", horizons = 1:9)
## Warning in horizon == horizons: longer object length is not a multiple of
## shorter object length

plotCoverage(bitcoin_af, pi = 90, methods = "naive", horizons = 10:19)
