tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

Master Equation and Kinetic model inconsistent with same parameters #102

Open odunbar opened 4 years ago

odunbar commented 4 years ago

Myself and @agarbuno were looking at efficacy of different tests, and noticed that we seem to get very different paced epidemics when running master equations and kinetic model.

I have run the master and kinetic equations with:

This is achieved by setting transition_rates_ensemble[i] = transition_rates transmission_rate_community_ensemble[i] = transmission_rate_community

da_ric_tprobs_

The lines are from the master equation solution, the 'X's are totals for infected, hospitalized and deceased from the kinetic model.

odunbar commented 4 years ago

To me this looks like some parameters are being rescaled, or being used differently within one of the models?

odunbar commented 4 years ago

Partially Solved: The kinetic model recently changed the name of it's edge weights from SI->E to exposed_by_infected, therefore the master equations were reading in mean_contact_duration always as 1 . kinetic_and_master

odunbar commented 4 years ago

(Possibly) fully solved: The master equations and kinetic equations were not correctly synced in time - due to the start_time = -3/24 setting. I have added a settable start time to the master equations. I also reduced the 6hour static window to 3 hours. compare_kinetic_and_master

agarbuno commented 4 years ago

I can think of a test to see if the kinetic model and master equations are consistent. But to do so we need to: 1) keep the contact network static at a given contact interval 2) run, for this time interval and same contact network, several times the kinetic equations so that we can average the probabilities and compare them to master equations.

Is this possible with the current framework?

glwagner commented 4 years ago

Sorry, I did not mean to close this issue.

I opened a PR at #106 that adds a method run_with_static_contacts to the EpidemicSimulator for running with a static contact network. The PR adds an example that simulates an ensemble.

I'm not 100% sure if this is why I was assigned to this issue. Let me know if the PR makes progress towards solving this issue or not.