predict_baseline_fast: Creates the forecast of the baseline of sales based on...

View source: R/Predictor.R

predict_baseline_fastR Documentation

Creates the forecast of the baseline of sales based on historical data using only fast models

Description

This function has the same purpose as the predict_baseline() function but uses only the models which computation time are the smallest.

Usage

predict_baseline_fast(sales_data, frequency = 52, start = c(2014, 1),
  forecast_horizon = 52, size.te.set = 52, promo_done = FALSE,
  criterion = "accuracy", sizeroll = 11)

Arguments

sales_data

A vector containing historical sales data.

frequency

A numerical value specifying the frequency of the seasonality.

start

A vector of length 2 with the date of the first observation. It contains first the year and then the day/week/month according to your data.

forecast_horizon

An integer value specifying the number of observations to forecast.

size.te.set

An integer value specifying the size of the testing set.

promo_done

A logical variable specifying if promotions are done for the product.

criterion

A string variable specifying the selection criterion that should be used to select the model ("ME", "RMSE", "MAE", "MPE", "MAPE", "MASE", "ACF1", "Theil's U"). "accuracy" can also be used to reflect the needs of the company.

sizeroll

The window of the moving average or moving median when using the baseline() function.

smoother

The smoother that should be considered when using the baseline() function. It can be "mean", "median" or "loess".

Value

A list containing the select model, the associated graphs, the predictions and the confidence intervals, the accuracy measures and the same elements for all other considered models.

Author(s)

Grandadam Patrik

Examples

data("mydata")
my_baseline <- predict_baseline_baseline(mydata, promo_done = TRUE, criterion = "MAPE")
my_baseline$selected_model$PLOT # the plot of the selected model
my_baseline$selected_model$FORECAST # the forecast of the selected model
my_baseline$selected_model$ACCURACIES # the accuracies of the selected model

Upsylon/predictor documentation built on June 16, 2022, 4:48 p.m.