I think the problem is here:
ri
can’t depend on another unnamed dist. Note that neither vi
nor ri
are ever used in the model other than to inform PyMC what kind of distribution the initial point has.
You probably want to defind ri
as such:
ri = pm.Normal.dist(mu=0, sigma=np.exp(v[0]))
There’s a pm.RandomWalk
that accepts arbitrary innovation distributions, but I doubt you want a straightforward Beta
random walk where innovations are just Betas, as that will be something that will drift outside of [0, 1].
There was a model sometime ago, where each step was a posterior update, and if your model is similar it still isn’t easy to implement in PyMC: Behrens' Bayesian Learner Model : How to share parameters between steps? - #45 by ricardoV94
If on the other hand your model is just a simple sequence of interrelated points generated from betas (as opposed to interraleted full-blown distributions) you could implement it with a CustomDist
with a Scan
these days (just make sure to pass a logodds
transform): PyMC_timeseries_AR.ipynb · GitHub