Last active
July 6, 2023 06:00
-
-
Save abhijeet-talaulikar/d83ed24ee86aacc09fe234b3afff5960 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
posterior = pm.sample_posterior_predictive(trace, mmm) | |
predictions = posterior['posterior_predictive']['revenue'].mean(axis=0).mean(axis=0) * media['REVENUE'].mean() | |
media_decomp = pd.DataFrame({i:np.array(trace['posterior']["contribution_"+str(i)]).mean(axis=(0,1)) for i in channel_priors.keys()}, index=dates) * media['REVENUE'].mean() | |
plt.plot(media['REVENUE']) | |
plt.plot(predictions) | |
plt.title("Model Fit") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment