Poisson Model with Random Walk Parameters

So running your notebook, here are my thoughts/debugging below:

  1. Metropolis, bad idea for complex model
  2. Use default sampling (with NUTS), get gradient error
  3. Check prior, sd in GaussianRandomWalk is likely too small, change to sd=1
  4. Sample seems to go well (ie it ran without returning error), but get The gelman-rubin statistic is larger than 1.4 for some parameters. warning.
  5. check trace for all parameters, the normalizing in
adds_est = pm.Deterministic("adds", adds_star - tt.tile(adds_star.mean(axis=1), (adds_star.shape[1], 1)).T)
subs_est = pm.Deterministic("subs", subs_star - tt.tile(subs_star.mean(axis=1), (subs_star.shape[1], 1)).T)

makes the model unidentifiable, commented it out and modify the code, reran model.

  1. still got warning, check trace and model still unidentifiable because of the subtraction/addition. Indeed the model is still over-specify (there are more parameters than needed).

I am not sure what is the best approach here, maybe check out how others model similar problem: