I used A state space model distribution for pymc3 · GitHub as a base code to work upon. So the innov_like is evaluated at the current time point using previous time points which is why two different x variables (x_im1 and x_i). Does that make sense? I have been following your GitHub but it was not immediately clear how to modify your code to include Poisson random model.