mac-theobio / McMasterPandemic

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

Different error message for calibration start date being equal to the first observation date #229

Open papsti opened 2 years ago

papsti commented 2 years ago

Currently, if one tries to calibrate a flexmodel with a simulation start_date that is the same as the date of the first non-NA observation being calibrated to, the software will throw the following error:

Error in tmb_fun_args(model) : observations outside of simulation range

"outside" is a bit confusing because the simulation range coincides exactly with the observation range in the scenario described above. Moreover, issue is just with the start date (and not the end date), so I would suggest a new check during calibration that ensures model_uncalibrated$start_date < min(observed$date). If this condition isn't satisfied, the error should say something like "simulation start date must be strictly before first observation".

According to @stevencarlislewalker, this is only an issue because there was a software choice made not to calibrate the initial state vector. If there was a new feature to calibrate the initial state vector, the new check/error message I propose would be unnecessary.