update_main_forecasting_table: Update main forecasting table.

Description Usage Arguments Value Examples

View source: R/WRAPPER_update_main_forecasting_table.R

Description

update_main_forecasting_table is a wrapper function around the following functions to create, fill and/or update the main forecasting table and then store it on disk to prevent recalculation:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
update_main_forecasting_table(
  file_path = "",
  data,
  seasonal_periods = c(12, 3),
  min_train_periods = 25,
  max_train_periods = Inf,
  periods_ahead = 12,
  fc_methods = supported_fc_methods_uni_var(),
  overwrite_fc = FALSE,
  allow_negative_fc = FALSE,
  add_hierarchical_fc = FALSE,
  verbose = FALSE,
  parallel = TRUE
)

Arguments

file_path

A character string specifying a valid file path.

data

A tibble containing the data to be used for time series forecasting, which has been created using the initialize_ts_forecast_data function from tstools.

seasonal_periods

A vector of postive integer values indicating the number of data points that together compose a season (e.g. c(12,3) for quarterly and yearly seasonality when using monthly data).

min_train_periods

A positive integer value indicating the minimum number of periods of data required for the training time series objects.

max_train_periods

A positive integer value indicating the maximum number of periods of data to be used for the training time series objects.

periods_ahead

A positive integer value indicating the number of periods to forecast ahead.

fc_methods

A character vector specifying the forecast methods to add. For more info `?supported_fc_methods`.

overwrite_fc

Boolean, which is set to TRUE if all existing forecasts should be overwritten, or set to FALSE if only unavailable forecasts should be added.

allow_negative_fc

Boolean, which is to be set to TRUE if negative forecast values are allowed, or set to FALSE if negative forecast values should be overwritten by a value of zero.

verbose

Boolean, which is set to TRUE if status updates are valued, or set to FALSE if they are not.

Value

An updated tibble containing several columns of data required for time series forecasting, as well as a fc_models column with named lists with forecast models and forecast data, extended with a fc_errors column with the forecast values, actuals and resulting forecast errors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- tstools::initialize_ts_forecast_data(
   data = dummy_gasprice,
   date_col = "year_month",
   col_of_interest = "gasprice",
   group_cols = c("state", "oil_company"),
   xreg_cols = c("spotprice", "gemprice")
)
update_main_forecasting_table(
   file_path = file.path(tempdir(), "main_forecasting_table.RData"),
   data = data,
   verbose = T
)

ing-bank/tsforecast documentation built on Sept. 18, 2020, 9:40 a.m.