robyn_mmm  R Documentation 
robyn_mmm()
function activates Nevergrad to generate samples of
hyperparameters, conducts media transformation within each loop, fits the
Ridge regression, calibrates the model optionally, decomposes responses
and collects the result. It's an inner function within robyn_run()
.
robyn_mmm(
InputCollect,
hyper_collect,
iterations,
cores,
nevergrad_algo,
intercept = TRUE,
intercept_sign,
ts_validation = TRUE,
add_penalty_factor = FALSE,
objective_weights = NULL,
dt_hyper_fixed = NULL,
rssd_zero_penalty = TRUE,
refresh = FALSE,
trial = 1L,
seed = 123L,
quiet = FALSE,
...
)
InputCollect 
List. Contains all input parameters for the model.
Required when 
hyper_collect 
List. Containing hyperparameter bounds. Defaults to

iterations 
Integer. Number of iterations to run. 
cores 
Integer. Default to 
nevergrad_algo 
Character. Default to "TwoPointsDE". Options are

intercept 
Boolean. Should intercept(s) be fitted (default=TRUE) or set to zero (FALSE). 
intercept_sign 
Character. Choose one of "non_negative" (default) or
"unconstrained". By default, if intercept is negative, Robyn will drop intercept
and refit the model. Consider changing intercept_sign to "unconstrained" when
there are 
ts_validation 
Boolean. When set to 
add_penalty_factor 
Boolean. Add penalty factor hyperparameters to glmnet's penalty.factor to be optimized by nevergrad. Use with caution, because this feature might add too much hyperparameter space and probably requires more iterations to converge. 
objective_weights 
Numeric vector. Default to NULL to give equal weights
to all objective functions. Order: NRMSE, DECOMP.RSSD, MAPE (when calibration
data is provided). When you are not calibrating, only the first 2 values for

dt_hyper_fixed 
data.frame or named list. Only provide when loading
old model results. It consumes hyperparameters from saved csv

rssd_zero_penalty 
Boolean. When TRUE, the objective function DECOMP.RSSD will penalize models with more 0 media effects additionally. In other words, given the same DECOMP.RSSD score, a model with 50% 0coef variables will get penalized by DECOMP.RSSD * 1.5 (larger error), while another model with no 0coef variables gets unpenalized with DECOMP.RSSD * 1. 
refresh 
Boolean. Set to 
trial 
Integer. Which trial are we running? Used to ID each model. 
seed 
Integer. For reproducible results when running nevergrad. 
quiet 
Boolean. Keep messages off? 
... 
Additional parameters passed to 
List. MMM results with hyperparameters values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.