Is there a way to force/hack zero 'contribution' from holiday binary variables? #329
-
In its current form, all holidays are lumped together when calling Prophet. But since the effect of different holidays can be different, I have decided to leave out "holidays" from Prophet
and instead generate a number of binary flags to represent certain holidays individually:
I then run the model, and in the While this may make sense from a purely statistical point of view, it doesn't from a business/interpretation point of view. That is to say, if we look at a non-'Christmas' day, there should not be any 'Christmas' contribution - the contribution (whether positive or negative) should only be defined on the 'Christmas' day, and should be zero on all other days (by definition). i.e., it should look more like this: Here, the 'Christmas' variable has a combined contribution of Is there a way to force/hack zero 'contribution' from holiday binary variables? (when the binary flag = 0) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Great question - while their isn't a way to force zero contribution currently, there is a way to force the coefficient for a particular variable to have a negative (or positive) sign, which may fix the problem. Could you try setting |
Beta Was this translation helpful? Give feedback.
-
Yeah, I get what you mean, but I'm always a bit hesitant of enforcing the coefficient to have a negative or positive sign. Take Christmas day for example - its effect may be negative (because people are with their families) but it may very well be positive (because people have free time to browse e-commerce sites). Both are entirely plausible, and so I'd want to avoid explciitly setting the coefficient to be positive/negative because that will essentially ingrain my biased/incomplete view of the world onto the model. |
Beta Was this translation helpful? Give feedback.
-
Thinking about it more, I may treat it as an organic (free) media variable, i.e., when the media variable is zero, its contribution to the dependent variable can only be zero. There is the issue that the model will attempt to apply adstock to the variable, but if I fix the adstock decay rate as zero, then that should solve that problem. Given it's an organic (read: free) variable, I don't have to worry about dealing with the Hill transformation. In summary, here's my proposed solution:
In my head, that solves the problem, but let me know if you think I'm missing something. I'll report back with the results. |
Beta Was this translation helpful? Give feedback.
-
I think that organic media hack may end up working the same as your initial example where all the non-christmas days were positive and christmas was zero. My recommendation of using the |
Beta Was this translation helpful? Give feedback.
-
Solution: treat the binary variable as an organic media variable. In practice, this means:
After re-running the model using this 'hack', I seem to be getting the 'behaviour' I want, i.e., zero contribution on days when |
Beta Was this translation helpful? Give feedback.
Solution: treat the binary variable as an organic media variable.
In practice, this means:
organic_vars
so that zero 'impressions' will give zero return, e.g.,organic_vars = c("Christmas_Day")
organic_signs = c("default")
Christmas_Day_thetas = 0
inhyperparameters
After re-running the model using this 'hack', I seem to be getting the 'behaviour' I want, i.e., zero contribution on days when
x=0
and non-zero contribution on days whenx=1
.