-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ODE models to Stan 2.24's solvers, as current method is deprecated. #263
Comments
New solvers are here. This would apply to the |
Thanks. This is good to update. The question is if we should update existing models or add new versions. I assume the log density might be slightly different with different solvers, right? |
Both the old and new solvers seem to use the same RK4(5) method (in this case, Dormand-Prince). Maybe the new solver is faster, or more numerically stable, but I'm not sure. I think the question is whether or not Stan ever intends to drop support for the deprecated solvers. If they do, these models will eventually stop working, and updating them is at least a little important. If they don't, this basically falls into the "Make Models More Performant" #224 issue. |
Ah. Ok. Do you know if the old and new solvers give the same log density? I assume they would (but I have not worked much with ODEs)? This reminds me that we probably should decide on how to define ”identical” models. I have just assume identical models have proportional log densities. But here we also have an approximation from the solver, I guess. |
Ok, so I found the release notes for the newer solvers. From this, my assumption is that the actual solver code stays the same, and the new interface simply provides a more efficient way of setting up the problems. So, I think the log density should remain the same also. From the release:
Basically, what I think is going on, is that in the past ODEs need to be specified like this (pseudocode):
And with the new interface, you pass the parameters directly:
and this is faster because it's costly to create intermediate variables (maybe for memory management reasons? but I'm not sure.) Also, the Stan manual notes:
So we have time before this breaks. I assumed it'd break in three versions from 2.4, but they specifically flag this as something that exists until 3.0. So I guess my takeaway is that:
|
Thanks. Yes. I agree. Lets leave this issue here. If you change the ODEs here feel free to do a PR. |
Diffeqs should perhaps updated to use the new
ode_rk45
. I can take a look at this personally, if you want.Sorry for the initial blank issue, I hit enter by accident while drafting this 😕 .
The text was updated successfully, but these errors were encountered: