forecast_forunco: Forunco function for batch forecasting in R

Description Usage Arguments Value Examples

View source: R/ts_forecast.R

Description

Implements the forunco function for optimal parallelisation with machine learning services of sql server 2017

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
forecast_forunco(
  ts_col,
  h = 12,
  num_cores = NULL,
  num_cores_ignore = 1,
  prog_bar = T,
  levels = c(95),
  methods = c("auto_ets", "auto_arima", "auto_dotm"),
  point_combination = "median",
  pi_combination_upper = "median",
  pi_combination_lower = "median",
  pool_limit = length(methods),
  error_fun = "rmse",
  weight_fun = "inverse",
  val_h = h,
  sov_only = F,
  max_years = 30,
  val_min_years = 4,
  cv_min_years = 5,
  cv_max_samples = 3,
  allow_negatives = F,
  ...
)

Arguments

ts_col

list of time series objects

h

number of horizons to predict

num_cores

number of cores to be used; default: NULL (all cores)

num_cores_ignore

number of cores to be ignored for e.g. OS; default: 1

prog_bar

boolean, whether or not a progress bar should be displyed

levels

Prediction interval levels. Optional, default c(95).

methods

Methods to be combined. Optional, default auto_ets, auto_arima, auto_dotm.

point_combination

Point forecast combination operator. Optional, default meidan.

pi_combination_upper

combination operator of the upper bound of the prediction intervals. Optional, default max.

pi_combination_lower

combination operator for the lower bounds of the prediction intervals. Optional, default min.

pool_limit

number of methods selected from the pool to reach the final forecasts. Optional, default length(methods).

error_fun

error function to determine the validation performance Optional, default rmse.

weight_fun

weight function for calculating the definitive weights for combination. Optional, default inverse

val_h

The horizon for the validation samples. Optional, default h.

sov_only

Flag indicating whether only single origin validation should be considered. Optional, default TRUE.

max_years

Maxmium of years to consider during model fitting. Optional, default 30.

val_min_years

Minimum years required to conduct single origin validation. Optional, default 4.

cv_min_years

Minimum years required to conduct cross-origin validation. Optional, default 5.

cv_max_samples

Maximum samples that should be considered during cross-validation, i.e. 3 indicates the algorithm validates from 3 origins. Optional, default 3.

allow_negatives

Flag indicating whether to allow negative values or not. Optional, default FALSE.

...

Value

list with mean, pis and data_frame containing the predicted values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
library(tritelligence)
library(Mcomp)
m3 <- M3[2000:2025]
#a time series colllection has n elements, each of which is a time series
# object.
ts_col <- lapply(m3, function(x) {x$x})

result <- forecast_forunco(ts_col)
preds[[1]]
$mean
[1] 5054.439 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170 5048.170

$upper
[1] 6348.204 6883.349 7294.081 7640.378 7945.488 8221.338 8475.014 8711.134 8932.906 9142.665 9342.174 9532.805

$lower
[1] 3760.6740 3149.1485 2453.7666 2132.0499 2054.5814 1887.5394 1633.8633 1397.7433 1175.9717  894.6316  766.7032  576.0728

$preds
# A tibble: 36 X 3
date  type    value
<date>     <chr>    <dbl>
1989-07-02 Point 5054.439
1989-08-02 Point 5048.170
1989-09-02 Point 5048.170
1989-10-02 Point 5048.170
1989-11-02 Point 5048.170
1989-12-02 Point 5048.170
1990-01-02 Point 5048.170
1990-02-02 Point 5048.170
1990-03-02 Point 5048.170
1990-04-02 Point 5048.170

## End(Not run)

yvesmauron/univariate-time-series-forecasting documentation built on March 2, 2020, 12:20 a.m.