mrc-ide / safir

squire and friends individual rewrite
https://mrc-ide.github.io/safir/
Other
1 stars 2 forks source link

bug in infection process vaccine between R and C++ #83

Closed slwu89 closed 1 year ago

slwu89 commented 1 year ago

See https://github.com/mrc-ide/safir/pull/82#issuecomment-1694754627

It appears the R one is right and the C++ one is subtly wrong somewhere, despite the NAT calculations being consistent between the two. What I should do is to run a simulation for some number of timesteps using the R version (with vaccinations and everything). Then set up functions for the R and C++ infection processes and run those for a subsequent timestep to figure out exactly where the divergence is occurring. Do it on a small population and use the same RNG seed.

slwu89 commented 1 year ago

Might be due to inplace bitset updates of the susceptible bset in the C++ vs. not inplace (yet) for the R version. Check this and adjust if discrepancy.

slwu89 commented 1 year ago

cleared up https://github.com/mrc-ide/safir/pull/82/commits/fcc9df3dece61afe72212ecf5f0a446d93f18438