baseline: Generates a baseline based on historical data

View source: R/Predictor.R

baselineR Documentation

Generates a baseline based on historical data

Description

This function enables to generate a baseline based on historical sales data and to plot the resulting graph. It eliminates the role of external impactors that have a significant effect on the sales to obtain a smooth baseline.

Usage

baseline(sales_data, promo_done = FALSE, sizeroll = 11,
  smoother = "mean", showgraph = FALSE)

Arguments

sales_data

A vector containing historical sales data

promo_done

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

sizeroll

An odd integer that determines the width of the rolling median and rolling average to take.

smoother

The smoother that should be considered. It can be "mean", "median" or "loess".

showgraph

A logical value. If TRUE, returns the graph obtained from the analysis.

Value

A vector containing the historical values, a vector containing the baseline, vector composed of binary variables that indicate whether an external impactor was detected for a given period.

In option, the graph obtained in the process if showgraph == TRUE.

Author(s)

Grandadam Patrik

Examples

data("mydata") 
baseline(mydata, promo_done = TRUE, showgraph = TRUE)

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