Applications of dynamic causal modeling

Has anyone applied some of the “dynamic causal modeling” as proposed by Friston, in stan, especially outside neuroscience?

This paper Gradient-based MCMC samplers for dynamic causal modelling mentions Stan for example.

I also found a reference to Variational Laplace, and was curious what it is.

Does DCM require a different sampler?


I don’t know almost anything about those models, but since nobody else answered, I will give it a try.

The model in the paper looks like it should - at least in principle - be possible to fit with Stan. Since the paper mentions some of @betanalpha’s work to motivate NOT using Stan for the model, I would be interested in hearing Mike’s thoughts on whether the criticism is sensible and if it also applies to later evolution of the Stan sampler (because Stan != NUTS and a lot of work has been done on Stan since 2016)

Wouldn’t that be variationl inference with using the Laplace distribution as the approximating family?

Hope you can move forward with your model.

I have a lot of hesitations about how these models are employed in practice (abusing model selection methods to try to “learn” causal structure, implicitly defining prior models to avoid chaotic behavior in dynamical systems, etc) but the models themselves are technically within the scope of Stan. In other words they can readily be implemented as well-defined Stan programs.

Stan, however, will also not be quiet about computational problems inherent to these models that hand-written samplers might ignore (the included papers list many references to support their hand-written samplers, but they also make some common misunderstandings about how Markov chain Monte Carlo works). Although frustrating these diagnostics will allow you to investigate and understand these less-than-ideal model consequences in a way that no other method will, which makes it a rare feature.

The most subtle challenge here will be the chaotic nature of the dynamical systems. Stan’s ODE integrators will do their best, but once the dynamical systems become unstable the numerical evaluation of the states and the gradients will tend to decouple which will degrade the performance of Stan’s dynamic Hamiltonian Monte Carlo sampler.

tl;dr Yes these models can be implemented in Stan, but they may be challenging to fit. That said they’re no easier to fit with other methods and Stan is uniquely capable of guiding investigations of the fitting problems.