-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epidemic Data Storage with example #110
Conversation
Looks pretty good. Could you please run an ensemble of kinetic simulations, to make sure the ensemble mean tracks the ME solution reasonably well? |
@tapios This actually is not going to be so easy, as different realizations of the kinetic model will lead to different hospitalizations and therefore different contact networks. We can try running an epidemic without the |
In that case, running parallel kinetic and master equation ensembles would make sense. Presumably, the noise in the master equations (from the network) will be much less. |
Might be good to average the ME and kinetic ensembles. Hard to see much on these plots. It looks like infections in the kinetic simulations rise more slowly—is this perhaps because of the closure issues? (Is there any closure beyond the mean-field approximation in the ME model in these simulations?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hold off until #111
@tapios (also @agarbuno if you are interested). This is the plot for the mean values of 10 ensemble runs for 100 days of the kinetic (X) and master equations (--) (for the 1000 node model). There are discrepancies but I think these deviations are present even without the save-data feature of this PR- we will need to test further, but i feel this is not for this PR. PS on my laptop it takes perhaps 25mins per 100day run (epidemic_model + master equations). |
All changes are now resolved and conflicts resolved with #111 . I shall merge now |
With regards to 'decoupling the data assimilation loop' in Issue #89 , and Issue #83
I provide 2 Classes and a simple example in view of storing and accessing contact networks, and
status
data by start or end time. This should greatly simplify the indexing required in DA schemes.In
epidemic_data_storage.py
StaticIntervalData
class stores a static contact network, a start time, an end time, and one can also set data (statuses dictionary) at the start time or end timeStaticIntervalDataSeries
stores a dictionary ofStaticIntervalData
s, one can access anyStaticIntervalData
by providing a start time or end time.In
saving_contact_networks.py
i have a simple save and load scenario for a series of networks and statuses.To demonstrate it's function: assume we have saved a series
epidemic_data_storage
and we are interested in loading a static network calledab_network
fixed for a time interval[a,b]
. When running forwards in time our current simulation time on loading this network will be timea
. We can load our network by:ab_network = epidemic_data_storage.get_network_by_start_time(a)
if however we were running backwards in time our current simulation time on loading this network would be time
b
. We can then load our network by:ab_network = epidemic_data_storage.get_network_by_end_time(b)
I have added more recently an example
saving_contact_networks_kinetic_and_master.py
which first runs an epidemic, and saves data. Then afterwards, loads data and runs the risk simulator.(For completeness, I also have an example
saving_contact_networks_ensemble_kinetic_and_master.py
which runs and ensemble of epidemics, and ensembles of risk simulations (one for each epidemic) then plots the mean epidemic and mean risk - though this is merely to reproduce tests requested in the PR comments)