During the Corona pandemic in 2020 with no vaccine available several
measures where proposed by several organizations to deal with the epidemic.
Some of the proposed and instated measures were very draconian.
But which of these measures or combination thereof are most efficient in terms of epidemic control but still ensuring a normal way of life?
Having worked in epidemiology decades ago I knew how to model a disease.
Having worked with partially observable Markov chains also decades ago
I also knew how to find a best set of actions, given that the state of the
world is not well known. So I decided to combine both to find an answer.
The aim of the toolbox is not to simulate the outbreak in a large town or a country.
But simulating even a smaller community you can get an idea of the effectiveness of
several actions or combination of actions. If you want to know how the situation would look like in a town of 1 Mio. people just simulate a town size of 10.000 people and multiply the results by 100.
The aim of the toolbox is also not to fit the disease parameters as e.g. incubation period etc. accurately. Given that most of the parameters are not well known and possibly having quite a large variance a "less is more" approach is better suited.
The disease is modeled in compartments
In order to model actions as well compartments like
- isolated being infectious
- isolated being susceptible
- intensive care
are added. The transitions of changes between these
compartments, i.e. states, are modeled using transition matrices.
- intensive care
are also modeled.
The model uses a POMDP approach to model the uncertainty in
observations (Partially Observable Markov Decision Process).
I recommend to read the article "planning and acting in partially
observable stochastic domains" by L.P. Kaebling et al. 1997.
The possible actions are
- do nothing
- try to find out if someone is infectious
- isolate an infectious
- isolate a susceptible
Given a set of "rewards" for each state and action combination
the model tries to find the optimal "greedy" action.
I.e. the current version of the code implements just a 1-step policy
of action selection.
HowTo use it?
Almost all parameters are in person.m. Please edit them and play with the toolbox. You could e.g. set the probability of successful vaccination to one. Or you could set the isolation time to a value smaller than the disease duration and have a look at the action selection. Another important value is the probability of one person infecting another one. This can be tuned in the file test_community by changing the parameter ContactsPerDay and the exponent in the probability calculation function.
You can run the test_*.m functions of the toolbox to get an idea.
First use ">> test_all" in order to find out if everything works on your system.
to close all windows.
Start again with
this will give you a multiplot of the state of the person, the belief what the state could be, the difference between state and belief and the actions taken over time.
After that use
to simulate how several persons interact with each other via the connectivity matrix.
There will be two plots. One is a view of the different compartments over time and the second one displays the frequency of the different actions taken over time.
Last you can run a stochastic simulation with
That will take a little bit longer, but will give you an idea if the set of measures is robust or not.
Here only one plot is shown with the compartments over time but with the mean value as well as a thick red line. If the single simulation spread around that mean value vary much, than the set of measures is not robust.
Jens Kappey (2021). epidemic management toolbox (https://github.com/jk-cloud/sir_pomdp/releases/tag/1.2), GitHub. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!