grantbrown / ABSEIR

A Flexible and Computationally Efficient SEIRS Modeling Framework
6 stars 3 forks source link

Future projections #3

Closed morgansmith57 closed 7 years ago

morgansmith57 commented 8 years ago

I have had success running fitting simulations with ABSEIR, but I am wondering if it is possible to predict future infection patterns. For example, if you only give the model the first half of the data, can we run the simulation forward in time to see what the predicted infection pattern would be? Thanks!

grantbrown commented 8 years ago

Yep, the easiest way is to include the period you want to forecast in the data model as missing values. This approach does have the disadvantage of requiring ABSEIR to simulate over a longer epidemic time during the whole fitting process, even though we only care about the forecast of the final fitted model.

To get around this, you can fit a model and then carefully modify the resulting model object to include these missing values (and appropriate covariates etc.) before providing it to epidemic.simulations, but that approach is obviously not ideal.

I've been meaning to write a generic predict function to take care of these bookkeeping details, but in the meantime I can provide some example code if that would be helpful.

morgansmith57 commented 8 years ago

Example code would be great if you don't mind!

grantbrown commented 7 years ago

Sorry for the (extremely) late reply.

This isn't a feature I've been using much, but I've finally gotten around to reintroducing/testing it.

Check out the following example: based on the 1995 Kikwit data

The basic idea is to leave the future data as NA's in the data model, but still provide any temporal co-variate information required to make projections. The way this is coded, it shouldn't have a huge cost over running the models without keeping track of compartments, except with a large number of spatial locations.

grantbrown commented 7 years ago

This will require the latest version of ABSEIR (1.2.1)