Description Usage Arguments Details Examples
View source: R/promotion_impact.R
compareModels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
data |
Dataframe containing date, target variable, and some additional time dummies that the researcher wants to account for. |
promotion |
Dataframe containing promotion ID, start date, end date, promotion tag(type). Might include daily payments associated with the promotion. |
fix |
A List of constraints to find the best model. Constraints can only be in following list: 'period','trend','logged','synergy.var','differencing','smooth.origin','structural.change','synergy.promotion' |
time.field |
Specify the date field of 'data'. |
target.field |
Specify the target field of 'data'. |
dummy.field |
Specify the additional time dummies of 'data'. |
trend.param |
Flexibility of trend component. Default is 0.05, and as this value becomes larger, the trend component will be more flexible. |
period.param |
Flexibility of period component. Default is 3, and as this value becomes larger, the period component will be more flexible. |
var.type |
'smooth' to use smoothed promotion variables, 'dummy' to use dummy promotion variables |
smooth.except.date |
Date value that will be excluded from the smoothing process. eg) '01' to exclude every start day of a month |
smooth.bandwidth |
Bandwidth of local polynomial regression used in the smoothing process. Default value is 2. |
smooth.var.sum |
If TRUE, the smoothing values for times when multiple promotions in a single tag overlap will be the values from the latest promotion. Otherwise, the values will be added(default). |
allow.missing |
TRUE to allow missing data in promotion sales during the promotion period |
compareModels compares several models under user-defined conditions and suggests the best options.
1 2 3 4 5 6 | comparison <- compareModels(data = sim.data, promotion = sim.promotion.sales,
fix = list(logged = TRUE, differencing = TRUE, smooth.origin='all',
trend = FALSE, period = NULL),
time.field = 'dt', target.field = 'simulated_sales',
trend.param = 0.02, period.param = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.