Mu of pm.Normal() depends on output of RandomVariable on previous time step. How do I implement this?

The thing is you can’t create PyMC variables inside a Scan. Your other alternative is to work purely on the logp side of your model. Assign Flat priors to all your variables outside of the scan, pass them as sequences and then at the end define a Potential with the expression that represents the whole model joint-probability.