Dynamic linear models

I don’t believe any of the filtering or smoothing could be done without a Scan Op, unless the models were of a very specific and simple variety (e.g. they had Markov dependencies that could be reduced to vectorized operations).

PyMC3 operates almost exclusively on log-likelihoods, which are absent from that exposition. In order to use PyMC3’s log-likelihood driven samplers, one would need to convert those “sample-space” (i.e. random variable) graphs to “measure-space” (i.e. log-likelihood) graphs.

Here’s a rough draft describing the manual conversion of such graphs into PyMC3-compatible Distributions. I had started to create some tools to automate the process, but quickly noticed that certain aspects of PyMC3 make that unnecessarily difficult and inconsistent. The correct approach is to make these changes from within PyMC3, and that’s what we’re starting to do.

2 Likes