vignettes/hdg/Readme.md

Forecast HDG price

Plot

readd(data_HDG) %>%
  plot_time_series(date, value, .interactive = interactive)

Divide data to train/ test

readd(splits_HDG) %>%
  tk_time_series_cv_plan() %>%
  plot_time_series_cv_plan(date, value, .interactive = FALSE)

Modeltime Table

readd(models_tbl_HDG)
#> # Modeltime Table
#> # A tibble: 4 x 3
#>   .model_id .model   .model_desc                              
#>       <int> <list>   <chr>                                    
#> 1         1 <fit[+]> ARIMA(0,1,0) WITH DRIFT                  
#> 2         2 <fit[+]> ARIMA(0,1,0) WITH DRIFT W/ XGBOOST ERRORS
#> 3         3 <fit[+]> ETS(M,AD,M)                              
#> 4         4 <fit[+]> PROPHET

Calibration

readd(calibration_tbl_HDG)
#> # Modeltime Table
#> # A tibble: 4 x 5
#>   .model_id .model   .model_desc                               .type .calibration_data
#>       <int> <list>   <chr>                                     <chr> <list>           
#> 1         1 <fit[+]> ARIMA(0,1,0) WITH DRIFT                   Test  <tibble [59 x 4]>
#> 2         2 <fit[+]> ARIMA(0,1,0) WITH DRIFT W/ XGBOOST ERRORS Test  <tibble [59 x 4]>
#> 3         3 <fit[+]> ETS(M,AD,M)                               Test  <tibble [59 x 4]>
#> 4         4 <fit[+]> PROPHET                                   Test  <tibble [59 x 4]>

Forecast (Testing Set)

readd(forecast_tbl_HDG) %>% 
  plot_modeltime_forecast(.legend_max_width = 25, 
                           .interactive      = interactive)
#> Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning -Inf

Accuracy table

readd(accuracy_tbl_HDG)$`_data`
#> # A tibble: 4 x 9
#>   .model_id .model_desc                               .type   mae  mape  mase smape  rmse   rsq
#>       <int> <chr>                                     <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1         1 ARIMA(0,1,0) WITH DRIFT                   Test   5.84  9.55  6.02 10.2   6.92  0.82
#> 2         2 ARIMA(0,1,0) WITH DRIFT W/ XGBOOST ERRORS Test   5.41  8.83  5.59  9.41  6.56  0.82
#> 3         3 ETS(M,AD,M)                               Test   7.3  11.9   7.54 13.0   8.75  0   
#> 4         4 PROPHET                                   Test   3.78  6.21  3.9   6.47  4.47  0.82

Next week forecast

readd(two_week_fc_HDG)
#> # A tibble: 5 x 6
#>   .ticker .index     .value  .low .high .model_desc
#>   <chr>   <date>      <dbl> <dbl> <dbl> <chr>      
#> 1 HDG     2022-01-03   63.9  56.5  71.3 PROPHET    
#> 2 HDG     2022-01-04   64.2  56.8  71.6 PROPHET    
#> 3 HDG     2022-01-05   64.4  57.0  71.8 PROPHET    
#> 4 HDG     2022-01-06   64.6  57.2  72.0 PROPHET    
#> 5 HDG     2022-01-07   64.8  57.4  72.2 PROPHET


nguyenngocbinh/bml_stocks documentation built on March 20, 2022, 7:11 a.m.