Garve / mamimo

A package to compute a marketing mix model.
68 stars 12 forks source link

code for plot graphic #2

Closed raismartup closed 1 year ago

raismartup commented 1 year ago

Hi Sr.Garve

Congralutations for your project! It´s fantastic :)

Although it is not a question especially of the mamimo package, I would like to know if you could pass me the code to be able to represent the saturation and carryover effects of your article in towardsdatascienc:

https://towardsdatascience.com/an-upgraded-marketing-mix-modeling-in-python-5ebb3bddc1b6

Specifically these that I show below

image

image

I can't figure out how to get this data to plot the graph and check both fantastic effects shown here.

Thanks for your help :)

Garve commented 1 year ago

Hello!

The first graphs are just the functions 1-exp(-a*x) where a is the best saturation parameter.

The second row is c^x where c is the best carryover value, and the x are the integers from 0to 5.

Hope that helps!

Best Robert

raismartup commented 1 year ago

Hi again!

thank you for your reply :)

I had asked for the plot code because I can not get them to appear exactly the same because in the saturation I get the price for the Radio is 7700 and yet in the graph appears values of 15000. I don't know if at the end you are adding the amount of each x weeks or if it is an aggregate sum of each week.

In the carryover graphs I don't know how you get this %. Do you do the percentage every 5 lags? or how?

Thank you for your kindness :)

Best Rai

Garve commented 1 year ago

Hi!

Well, you can decide the price range however you want. I chose 0 to 15000, but you can also make this range larger or smaller. I'm really just plotting 1-exp(-ax) there, nothing more, nothing less. If a=0.0001, just plot `1-np.exp(-0.0001x)` from x=0 to 15000, for example.

In the carryover, just do 0.5**np.arange(5) and plot this as a bar chart if you wanna plot the carryover for 5 days, with a strength of 0.5. Then just format the y-Axis to percentages, and you are done.

Best Robert

raismartup commented 1 year ago

Hi!

I think I understood perfectly the carriover graph :)

To finish, I understand that in the graphs of Baaners and Radio only appear 100% because the length in the optimization of hyperparameters is 0 no? understanding that only the advertising has only effect the first week

(0.5**np.arange(5))* np.array([1, 0, 0, 0, 0])) in the case length = 0 (0.5**np.arange(5))* np.array([1, 1, 1, 0, 0])) in the case length = 2

thank you very much :)

Garve commented 1 year ago

On day 0, 100% of the spending effect is still in place. On day 1, only 100%50%=50%. At day 2 only 100%50%*50%=25%, etc. That's all that graphic says.

raismartup commented 1 year ago

Thank for you help! :)