Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcing an external variable to provide negative contribution #323

Open
karjeswal opened this issue Jun 14, 2024 · 0 comments
Open

Forcing an external variable to provide negative contribution #323

karjeswal opened this issue Jun 14, 2024 · 0 comments

Comments

@karjeswal
Copy link

Hi,

I've got a model that I'm happy with but I have one external variable that keeps giving be positive contribution regardless of what I'm trying. The variable in question is competitor media spend with the rationale, the more competitors spend it would affect the number of sales negatively for set business.

I've set up the following list of data (some non media variables are included in media as I need to control them to be positive):
pic 1

I then try and play around with the model.py source code for the ext_negative factors, see image below. Whatever I try to force these values to be I either end up with:

  1. A very poor model that deteriorates as the values inputed completely ruin the fit.
  2. Values that hardly move at with a similar model fit as in my first attempt.
pic 2

I've also tried to run this with a HalfNormal distribution instead of TruncatedNormal but without any success. My ultimate goal would be to get within a certain range of contribution for competitor spend (as there was an MMM previously done that had this as negative). Ideally I would like to control this in a similar fashion as for media variables but being able to keep them as negative.

Lastly, I've also tried to include them in the media vars part and tried to force them to be negative in the media tuning params, but I still end up with only positive cases.

pic 3

Any guidance would be much appreciated and if you need more info regarding the code, let me know.

Cheers.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant