simulate_sales_lag: Simulate trends with lag effects

Description Usage Examples

View source: R/simulations_f.R

Description

Simulate any trend with seasonal trends at the week and month level, and with lag effects.

Usage

1
2
3
4
5
6
simulate_sales_lag(
  time_period,
  baseline_week = c(0, 0, 5, -5, -10, -9, 8, 5, 0, -8, 0, -10),
  baseline_month = c(60, 55, 50, 49, 45, 15, 0),
  lag_variables = list(`1` = 0.5, `7` = -0.2)
)

Examples

1
2
3
4
5
6
sales_data2<-simulate_sales_lag(time_period=seq(as.Date('2019-01-01'),as.Date('2019-06-01'),1),
                               baseline_month=c(0,0,5,-5,-10,-9,8,5,0,-8,0,-10),
                               baseline_week=c(60,55,50,49,45,15,0),
                               lag_variables=list('1'=0.3,'7'=-0.2))

plot(sales_data2$date,sales_data2$total, type='l')

monkeypostulate/MarketingAnalyticsR documentation built on Feb. 9, 2020, 12:15 a.m.