mac-theobio / McMasterPandemic

SEIR+ model
GNU General Public License v3.0
20 stars 5 forks source link

lagged difference variables = 0 in forecast ensemble after last observation #235

Closed papsti closed 2 years ago

papsti commented 2 years ago

There seems to be a bug that has occurred somewhere between the latest commits on the master and tmb-condense branches (2c512006 and 8b1a0373, respectively). I believe master was last synced with tmb-condense on 10 June (97394ec3), so the bug seems to have been introduced into tmb-condense after that.

I have a bunch of code that runs a calibration and forecast ensemble: @stevencarlislewalker, you can find it in the macpan_forecast repo on the sw_debug branch, just source the run_this.R script.

When I run this script on a McMasterPandemic install from master, everything looks fine in the plot that appears. However, when I run it on an install from tmb-condense, the lagged difference variables are all 0 in the forecast ensemble on dates after the calibration end date (last observation date).

This isn't urgent for me as the install from the master branch works just fine.

stevencarlislewalker commented 2 years ago

Thank you for using master. I believe I know the feature that introduced this bug. I'll fix it on tmb-condense and test if it fixes your issue.

stevencarlislewalker commented 2 years ago

I've got a minimal example and was correct about the cause -- at least in my minimal version of the bug.

stevencarlislewalker commented 2 years ago

I have a fix ... testing now. Unfortunately it is going to go into the R0/Gbar commits/push, so I've still got some testing to do. But my understanding is that this will be fine.

Thanks for finding this.

papsti commented 2 years ago

Yes, all good! master doesn't have this bug and works for my current purposes 🎉

stevencarlislewalker commented 2 years ago

I've pushed my fix to tmb-condense. I'm not going to merge to master until you let me know that it is safe.