Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
hello i'm trying to replicate the saturation hill function and it seems that even though I increase the investment it does not saturates, here is the code that is based on the definition you have in R:
`
def saturation_hill(x, alpha, gamma, x_marginal=None):
inflexion = np.dot(np.array([1 - gamma, gamma]), np.array([np.min(x), np.max(x)]))
if x_marginal is None:
x_scurve = xalpha / (xalpha + inflexionalpha)
else:
x_scurve = x_marginalalpha / (x_marginalalpha + inflexionalpha)
x_scurve = 1 / (1 + (gamma / x) ** alpha)
return x_scurve
What do you mean by "saturation"? If it's ROAS == 1 (media break even), then by eyeballing your curve, it'll be around 1.3k raw investment. At 5k you got ROAS of 0.5 or so. What is "saturated" for you?
Project Robyn
Describe issue
hello i'm trying to replicate the saturation hill function and it seems that even though I increase the investment it does not saturates, here is the code that is based on the definition you have in R: ` def saturation_hill(x, alpha, gamma, x_marginal=None): inflexion = np.dot(np.array([1 - gamma, gamma]), np.array([np.min(x), np.max(x)])) if x_marginal is None: x_scurve = xalpha / (xalpha + inflexionalpha) else: x_scurve = x_marginalalpha / (x_marginalalpha + inflexionalpha) x_scurve = 1 / (1 + (gamma / x) ** alpha) return x_scurve
investment_array = np.linspace(0, 5000, 50) saturated_investment = saturation_hill(investment_array, params["alpha"], params["gamma"]) saturated_investment = params["coef"] * saturated_investment
`