epiforecasts / inc2prev

Estimate epidemiological quantities from repeated cross-sectional prevalence measurements
http://epiforecasts.io/inc2prev/
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

Example: Adding support for n differences #18

Closed seabbs closed 2 years ago

seabbs commented 2 years ago

This is an example of a potential extension for adding n differences. The default 0 would be a model that had the mean of the cases (now fit in model) as mean of the GP. A first order would be a model that had a 0 growth rate as the mean of the GP. A second order would be a model that had r_t-1 as the mean at time t, this would be a logit version of the EpiNow2 default. Higher orders possible and maybe sensible but likely hard to fit (i.e would be assuming change in growth rate continues unless supported by data).

seabbs commented 2 years ago

Some tweaks + switched to initialising the growth rates etc with their own parameters.

Some notes:

  1. All versions are slower than the version of the model on master. This is because all versions of the model are now scaled to a global mean which really they should always have been. When I first set the model up I looked at this and dropped due to run-time issues and it not making an apparent difference.
  2. Only the antibody model has been updated. I think we need to discuss what the aim of this is in order to decide what to support and what not to support. If wanting to support models with optional data requirements etc probably better do it in a single model vs supporting lots of sub-models with duplicate parts.
  3. As expected the growth rate model is quite a bit slower than the non-differenced model.
  4. Growth rate (and I assume higher order differences) need a higher max tree depth to fit without issues.
  5. Removing the antibody data from the likelihood gives a much improved fitting experience which makes sense as now likely misspecified.
seabbs commented 2 years ago

I've made the antibody model optional and renamed it to be the main model. I've also added date and gp approximation to the estimation script as if only interested in now we don't really need to estimate a whole year etc.

seabbs commented 2 years ago

growth infections pairs prev-logit prev Rt

seabbs commented 2 years ago

@sbfnk it would be good to know how your branch has diverged from this and/or what updates need to be made to support it? I've built subsequent updates on top of it so would be good to make sure makes sense.