-
Notifications
You must be signed in to change notification settings - Fork 320
Closed
Labels
MMMModelBuilderRelated to the ModelBuilder class and its childrenRelated to the ModelBuilder class and its children
Description
In the docs example for MMMs, the line of code to sample the posterior predictive is
mmm.sample_posterior_predictive(X, extend_idata=True, combined=True)
When X
is on the scale of dollars, the data wont get automatically scaled from mmm.sample_posterior_predictive
, so it causes the results to be off. The example doesn't run into this problem because channel spend is simulated as X ~ U(0,1)
. I personally got pretty confused adapting the code. to a real dataset and seeing the posterior predictive plot look so off and had to dig through the codebase to figure out what was going on.
I think the following is a more general approach that would lead to less confusion for now in the docs
mmm.sample_posterior_predictive(mmm.preprocessed_data['X'], extend_idata=True, combined=True)
An alternative to changing the docs could be to scale the X data in the mmm.sample_posterior_predictive
method
williambdean
Metadata
Metadata
Assignees
Labels
MMMModelBuilderRelated to the ModelBuilder class and its childrenRelated to the ModelBuilder class and its children