This function is called in robyn_engineering()
. It uses
the Michaelis-Menten function to fit the nonlinear model. Fallback
model is the simple linear model lm()
in case the nonlinear
model is fitting worse. A bad fit here might result in unreasonable
model results. Two options are recommended: Either splitting the
channel into sub-channels to achieve better fit, or just use
spend as paid_media_vars
fit_spend_exposure(dt_spendModInput, mediaCostFactor, paid_media_var)
List. Containing the all spend-exposure model results.
data.frame. Containing channel spends and exposure data.
Numeric vector. The ratio between raw media exposure and spend metrics.
Character. Paid media variable.