Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cetagostini-wise committed Mar 23, 2024
1 parent 5617c0b commit 1ffb125
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 deletions pymc_marketing/mmm/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,51 +684,53 @@ def michaelis_menten(
.. plot::
:context: close-figs
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from pymc_marketing.mmm.transformers import michaelis_menten
x = np.linspace(0, 100, 500)
alpha = 10
lam = 50
y = michaelis_menten(x, alpha, lam)
x = np.linspace(0, 100, 500)
alpha = 10
lam = 50
y = michaelis_menten(x, alpha, lam)
plt.plot(x, y)
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function')
plt.show()
plt.plot(x, y)
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function')
plt.show()
.. plot::
:context: close-figs
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 100, 500)
alpha_values = [5, 10, 15] # Different values of alpha
lam_values = [25, 50, 75] # Different values of lam
# Plot varying lam
plt.figure(figsize=(8, 6))
for lam in lam_values:
y = michaelis_menten(x, alpha_values[0], lam)
plt.plot(x, y, label=f"lam={lam}")
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function (Varying lam)')
plt.legend()
plt.show()
# Plot varying alpha
plt.figure(figsize=(8, 6))
for alpha in alpha_values:
y = michaelis_menten(x, alpha, lam_values[0])
plt.plot(x, y, label=f"alpha={alpha}")
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function (Varying alpha)')
plt.legend()
plt.show()
import numpy as np
import matplotlib.pyplot as plt
from pymc_marketing.mmm.transformers import michaelis_menten
x = np.linspace(0, 100, 500)
alpha_values = [5, 10, 15] # Different values of alpha
lam_values = [25, 50, 75] # Different values of lam
# Plot varying lam
plt.figure(figsize=(8, 6))
for lam in lam_values:
y = michaelis_menten(x, alpha_values[0], lam)
plt.plot(x, y, label=f"lam={lam}")
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function (Varying lam)')
plt.legend()
plt.show()
# Plot varying alpha
plt.figure(figsize=(8, 6))
for alpha in alpha_values:
y = michaelis_menten(x, alpha, lam_values[0])
plt.plot(x, y, label=f"alpha={alpha}")
plt.xlabel('Spend/Impressions (x)')
plt.ylabel('Contribution (y)')
plt.title('Michaelis-Menten Function (Varying alpha)')
plt.legend()
plt.show()
Parameters
----------
Expand Down

0 comments on commit 1ffb125

Please sign in to comment.