Principle of Stan implementation of ODE

What method Stan use to solve (Bayesian) ODE?
Would you please give some references for that?
I am asking this because there are many kinds of method of Bayesian ODE.

ODEs are solved numerically using the BDF, Adams-Moulton or RK45 method. See https://mc-stan.org/docs/2_23/stan-users-guide/ode-solver-chapter.html. Or matrix exponent can be used if the ODE is linear and has analytical solution.

3 Likes

So ODEs are solved using a deterministic numerical scheme. There are no Bayesian solvers implemented, if by them you mean methods which pose the numerical solution itself as a Bayesian problem. Only the parameters of the ODE system (and other parameters of the model) are treated in a Bayesian manner.

2 Likes

Thank you very much.

It is unclear for me:
â€śSo ODEs are solved using a deterministic numerical scheme.â€ť
=> Do stan() solution not Bayesian solution for the ODE???

â€śThere are no Bayesian solvers implemented if by them you mean methods which pose the numerical solution itself as a Bayesian problem. Only the parameters of the ODE system (and other parameters of the model) are treated in a Bayesian manner.â€ť
=> Would you please more clarify your comment. I am a statistician and can understand although argument is rigorous.

Just wonder, these days, it now gradually becomes a standard way to implement stan() for the ODE model, and typically, they say they used Bayesian modeling for the ODE. For e.g., please read â€śNeovascular Age- Related Macular Degeneration: A Visual Acuity Model of Natural Disease Progression and Ranibizumab Treatment Effectâ€ť or â€śBAYESIAN AGGREGATION OF AVERAGE DATA: AN APPLICATION IN DRUG DEVELOPMENTâ€ť

Depends on what you mean by Bayesian solution. Given fixed parameters, the solution is deterministic, but Stan samples the posterior distribution of the ODE parameters, and therefore solves the system many times with different parameter combinations. This is also what is done in that paper, although they have implemented their own method for the numerical solution in the functions block of the model.

To me, a Bayesian ODE solver would be something like this: https://arxiv.org/abs/2004.00623, but this is not what Stan is doing.

1 Like

Yes. I think this is a Bayesian solution for the given ODE.
Of course, here, one may need to assume priors for the parameters.

If stan() uses above mechanism, then stan() solution for the ODE is Bayesian solution for the ODE.

I found a good recent paper: â€śA Bayesian approach to estimate parameters of ordinary differential equationâ€ť using HMC.