Porting stan model to PyMC

Hi Blake,

that looks pretty good to me at first glance (I’ll try to take a closer look later). The only thing I’d suggest is to use the logit_p functionality in the Binomial rather than using the inverse logit. I’ve found that to be more numerically stable. I’d be surprised if it makes a big difference in this case since the probabilities are unlikely to be extreme, but it’s still worth a go I think. So I suggest replacing:

  p = pm.Deterministic('p', pm.math.invlogit(s[date_idx, server_idx] - r[date_idx, returner_idx] + intercept))

  spw = pm.Binomial('spw', combined['sp_total'].values, p, observed=combined['sp_won'].values)

with something like:

  logits = pm.Deterministic('logits', s[date_idx, server_idx] - r[date_idx, returner_idx] + intercept)

  spw = pm.Binomial('spw', combined['sp_total'].values, logit_p=logits, observed=combined['sp_won'].values)