Hierarchical AB testing in PyMC3

I’m not familiar at all with the potential functionality in pymc3, so I would do this a completely different way. For one, that joint distribution is not-normalized and it’s not clear how to draw from it properly (maybe \theta \propto \mathrm{Power}(-2.5), a \sim U(0, \theta), b=\theta - a …?). Instead I’d use the parameterization that makes the prior uniform:

with pm.Model() as hm:
  ratio = pm.Uniform('ratio', 0, 1)
  inv_root_sample = pm.Uniform('inv_root_sample', 0, 1)
  a = pm.Deterministic('a', (ratio/inv_root_sample**2))
  b = pm.Deterministic('b', (1 - ratio)/(inv_root_sample**2))
1 Like