# Dynamic linear models

**URL:** <https://discourse.pymc.io/t/dynamic-linear-models/6466>\
**Category:** Questions\
**Created:** [December 22, 2020, 12:15am UTC](https://discourse.pymc.io/t/dynamic-linear-models/6466 "2020-12-22T00:15:12Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![brandonwillard](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/brandonwillard/32/1464_2.png) [@brandonwillard](https://discourse.pymc.io/u/brandonwillard)\
**Post date:** [December 27, 2020, 11:11pm UTC](https://discourse.pymc.io/t/dynamic-linear-models/6466/7 "2020-12-27T23:11:52Z")

</div>

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](https://brandonwillard.github.io/drafts/theano-model-graphs.html) a rough draft describing the manual conversion of such graphs into PyMC3-compatible `Distribution`s. 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.

---

_[View the full topic](https://discourse.pymc.io/t/dynamic-linear-models/6466)._
