ImperialCollegeLondon / epidemia

epidemia package
https://imperialcollegelondon.github.io/epidemia/index.html
47 stars 15 forks source link

R should not be inferred during seeding period #54

Open ChrisHIV opened 4 years ago

ChrisHIV commented 4 years ago

R should not be inferred during seeding period, because infections then are modelled as iid from an exponential each day, not arising from a renewal process. My plot_rt() output shows me that it is being inferred during that period, and indeed the posterior is changing during that period.

jscott6 commented 4 years ago

What you see from plot_rt() is the R simulated from the posterior. Somewhat confusingly, even though only seeding is occuring during the first few days of the epidemic (and when R is not used), the plot shows the posterior predictive for R during this initial period. Rest assured however that the R here does not appear in the likelihood, so the inferences are unaffected by this issue.

Perhaps for clarity we should change the interface so that seeding is taken to occur prior to the first date found in 'data'? @agandy @s-mishra

ChrisHIV commented 4 years ago

Gotcha. Arguably the user might want either - to provide data that they think begins with a seeding phase (e.g. observed imported cases) or begins after it.

ChrisHIV commented 4 years ago

I do think it would be clearer to not plot R during the seeding period, because the user and the model are saying that cases during this period are not arising from a renewal process, so R at this point is undefined. And plotting a posterior for R that's different from 1 here, while plot_infections() shows constant incidence here, seems like a contradiction. Could simply truncate the x axis for plot_rt() (but not plot_infections(), as seeing the constant incidence clarifies the role of the seeding).