Skip to content

Instantly share code, notes, and snippets.

@ikatsov
Created February 26, 2019 19:18
Show Gist options
  • Save ikatsov/5c96457a11c5ecfa49f70227ce8d3c8c to your computer and use it in GitHub Desktop.
Save ikatsov/5c96457a11c5ecfa49f70227ce8d3c8c to your computer and use it in GitHub Desktop.
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