Created
February 26, 2019 19:18
-
-
Save ikatsov/5c96457a11c5ecfa49f70227ce8d3c8c 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
p0 = [15, 14, 13, 12, 11] # offered prices | |
d0 = [20, 28, 35, 50, 65] # observed demands (for each offered price) | |
with pm.Model() as m: | |
# priors | |
log_b = pm.Normal('log_b', sd = 5) | |
a = pm.Normal('a', sd = 5) | |
log_d = log_b + a * np.log(p0) # demand model | |
pm.Poisson('d0', np.exp(log_d), observed = d0) # likelihood | |
s = pm.sample() # inference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment