Switching ODE integrators between the warmup and the sampling phase

This came up in the Stan meeting, and it reminded me of the conversation @wds15, @yizhang and I had over here: Adams Moulton ODE solver in Stan useful?

We initially had two ODE solvers (RK45 and BDF) and the question of which to choose was posed to the modeler as ‘is your ODE stiff or not stiff’?

In that thread we get a third solver (Adams), which is apparently non-stiff, but when @wds15 and I tried to use the stiff/non-stiff rule and apply Adams to problems RK45 worked fine on, things went awry.

Anyway so we need to pick our solver somehow, and the thing I’d like to add is that however we end up making decisions between solvers (or generally configuring the solvers), the solvers in Stan are rather specific to Stan. Like, someone can develop their ODE out of Stan (and probably should, at some level), but the things that are true for solving this model in an R library might not translate.

I think the timing stuff @rok_cesnovar has been proposing for the language will be really useful here.

And this definitely seems like some sort of workflow thing to me. Even after the Adams/RK45/BDF discussions we had in the other thread, I still don’t know the checklist I would go to pick one of those things (other than use them all and see which is the fastest and compute reference solutions with super tight tolerances to compare against, which is all somewhat annoying).

3 Likes