fit_spend_exposure: Fit a nonlinear model for media spend and exposure

View source: R/inputs.R

fit_spend_exposureR Documentation

Fit a nonlinear model for media spend and exposure

Description

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

Usage

fit_spend_exposure(dt_spendModInput, mediaCostFactor, paid_media_var)

Arguments

dt_spendModInput

data.frame. Containing channel spends and exposure data.

mediaCostFactor

Numeric vector. The ratio between raw media exposure and spend metrics.

paid_media_var

Character. Paid media variable.

Value

List. Containing the all spend-exposure model results.


Robyn documentation built on June 27, 2024, 9:06 a.m.