epinowcast / primarycensored

Primary event censored distributions in R and Stan.
https://primarycensored.epinowcast.org/
Other
7 stars 1 forks source link

Issue 34: rephrase integral as an ODE #64

Closed seabbs closed 1 month ago

seabbs commented 1 month ago

Description

This PR closes #34.

Under the hypothesis that more work has been put into the ODE solvers vs the integrator and that they may therefore be more stable, I recharacterised the integral as an ODE problem and solved it using the ode_rk45 solver (likely worth exploring other options as well as tolerances). This appears to give a 4-5 times speed up and on the test data has no stability issues (i.e no chains out of 600 failed).

I am very unclear as to exactly why apart from above logic about dev time spent.

As part of testing this I have made the simulated logic significantly harder (a mix of window lengths and observation times).

Checklist

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.62%. Comparing base (c81f6dc) to head (2d62937). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #64 +/- ## ======================================= Coverage 99.62% 99.62% ======================================= Files 7 7 Lines 268 268 ======================================= Hits 267 267 Misses 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.