hill_saturation_sigmoid#

pymc_marketing.mmm.transformers.hill_saturation_sigmoid(x, sigma, beta, lam)[source]#

Hill Saturation Sigmoid Function.

\[f(x) = \frac{\sigma}{1 + e^{-\beta(x - \lambda)}} - \frac{\sigma}{1 + e^{\beta\lambda}}\]
where:
  • \(\sigma\) is the upper asymptote

  • \(\beta\) is the slope parameter

  • \(\lambda\) is the transition point on the X-axis

  • \(x\) is the independent variable

This function computes the Hill sigmoidal response curve, which is commonly used to describe the saturation effect in biological systems. The curve is characterized by its sigmoidal shape, representing a gradual transition from a low, nearly zero level to a high plateau, the maximum value the function will approach as the independent variable grows large. In this implementation, we add an offset to the sigmoid function to ensure that the function always passes through the origin as we expect zero spend to result in zero contribution.

(Source code, png, hires.png, pdf)

../../_images/pymc_marketing-mmm-transformers-hill_saturation_sigmoid-1_00_00.png

(png, hires.png, pdf)

../../_images/pymc_marketing-mmm-transformers-hill_saturation_sigmoid-1_01_00.png

(png, hires.png, pdf)

../../_images/pymc_marketing-mmm-transformers-hill_saturation_sigmoid-1_02_00.png
Parameters:
xfloat or array_like

The independent variable, typically representing the concentration of a substrate or the intensity of a stimulus.

sigmafloat

The upper asymptote of the curve, representing the approximate maximum value the function will approach as x grows large. The true maximum value is at sigma * (1 - 1 / (1 + exp(beta * lam)))

betafloat

The slope parameter, determining the steepness of the curve.

lamfloat

The x-value of the midpoint where the curve transitions from exponential growth to saturation.

Returns:
float or array_like

The value of the Hill saturation sigmoid function for each input value of x.