sibylhe / mmm_stan

Python/STAN Implementation of Multiplicative Marketing Mix Model, with deep dive into Adstock (carry-over effect), ROAS, and mROAS
MIT License
343 stars 160 forks source link

Potential error from line #483 #1

Closed Emnlv closed 3 years ago

Emnlv commented 3 years ago

Hi Sibyl,

First of all: thank you very much for your precious help! The code is really helpful. I decided to re run your example.

The line #483 def mmm_decompose_contrib(mmm, df, original_sales=df['sales']): This code doesn't find proper connection with line 514 and 517, about "X" variable. Has it to be "X2"?

In addition at line #578 mc_df = mmm_decompose_media_contrib(mmm, df, y_true=df['sales_ln']) I think that has to be "mmm_decompose_contrib" or viceversa at 483 "mmm_decompose_media_contrib" Here I am finding another issue: y_true =df["sales_ln"] Into the code I dind't find any kind of log transformation about the df for "sales" and also before, y_true it is not generated into the mmm_decompose, only "y_true2", that from line 555 to 556 a log transformation is made. How can we have to modify the code?

Again, Thank you for your support! Best

sibylhe commented 3 years ago

Thanks for pointing out the errors! I'll try to fix them probably by this weekend. Please stay tuned:)

On Thu, Jan 14, 2021 at 7:10 AM Emnlv notifications@github.com wrote:

Hi Sybil,

First of all: thank you very much for your precious help! The code is really helpful. I decided to re run your example.

The line #483 def mmm_decompose_contrib(mmm, df, original_sales=df['sales']): This code doesn't find proper connection with line 514 and 517, about "X" variable. Has it to be "X2"?

In addition at line #578 mc_df = mmm_decompose_media_contrib(mmm, df, y_true=df['sales_ln']) I think that has to be "mmm_decompose_contrib" or viceversa at 483 "mmm_decompose_media_contrib" Here I am finding another issue: y_true =df["sales_ln"] Into the code I dind't find any kind of log transformation about the df for "sales" and also before, y_true it is not generated into the mmm_decompose, only "y_true2", that from line 555 to 556 a log transformation is made. How can we have to modify the code?

Again, Thank you for your support! Best

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sibylhe/mmm_stan/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7HK4LBONTDIZBKXZ75BD3SZ4COVANCNFSM4WCSIMTA .

sibylhe commented 3 years ago

Fixed the function mmm_decompose_contrib(), mmm_stan.py has been updated. You are correct. Line 514 and 517, "X" variable should be "X2" Line 578 should call mmm_decompose_contrib(): mc_df = mmm_decompose_contrib(mmm, df, original_sales=df['sales'])

Thanks!

Emnlv commented 3 years ago

Fixed the function mmm_decompose_contrib(), mmm_stan.py has been updated. You are correct. Line 514 and 517, "X" variable should be "X2" Line 578 should call mmm_decompose_contrib(): mc_df = mmm_decompose_contrib(mmm, df, original_sales=df['sales'])

Thanks!

Thanks a lot Sibyl