Created
February 26, 2019 19:15
-
-
Save ikatsov/5719151c500c5a165a964a95a7e1fcab to your computer and use it in GitHub Desktop.
This file contains 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
import pymc3 as pm | |
d0 = [20, 28, 24, 20, 23] # observed demand samples | |
with pm.Model() as m: | |
d = pm.Gamma('theta', 1, 1) # prior distribution | |
pm.Poisson('d0', d, observed = d0) # likelihood | |
samples = pm.sample(10000) # draw samples from the posterior | |
seaborn.distplot(samples.get_values('theta'), fit=stats.gamma) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment