Created
May 28, 2020 14:06
-
-
Save petrushev/fa0cc0ac65590fee874e541b5fdc3f84 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
with pm.Model() as m: | |
pi = data.partner_id.astype('category').cat.codes.values | |
ii = data.item_id.astype('category').cat.codes.values | |
# [rest of priors here] | |
item_sigma = pm.Exponential('item_sigma', 1) | |
b_item = pm.Normal('b_item', 0, item_sigma, shape=ii.nunique()) | |
p = pm.math.invlogit( | |
a | |
+ .. | |
+ b_item[ii] | |
) | |
pm.Binomial('obs', p=p, n=data.observations.values, observed=data.successes.values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment