AR(1) bayesian regression with none negative values

I’m not really sure what model you ran to generate that graph. Whatever model it was, it has no way of knowing the observed values can’t be negative, especially before it’s seen the data. As I mentioned, you should either model the log of the data (avoiding the problem entirely), or change the innovation distribution (that’s the pm.Normal.dist(sigma=sigma) inside the ar_step function in the notebook I linked), as well as the ar_init distribution, to be strictly positive.