This time, I tried to simulate how the infection spreads as a starting point to correctly understand the contents mentioned by Mr. Merkel and Mr. Johnson and the contents announced by the Ministry of Health, Labor and Welfare.
At this time (April 1, 2020), some people may not want to do such a simulation, but I thought that people who read Qiita would understand the purpose and contents correctly. It may be erased when the time comes.
The source is available on github. (https://github.com/ryos36/sim-covid-19). Please note that there is no medical or mathematical basis (especially statistics). Also, the result is just a simulation. If you change the parameters, the result will match what you want.
The program is written in Python. There will be bugs as it hasn't been fully tested and made quite RAPID. I'm personally good at this point because I'm getting decent results. The parameters can be changed. For the time being, the explanation is given in Param.md (https://github.com/ryos36/sim-covid-19/blob/master/Param.md) on github. Maybe that's not enough. If you are interested, please read the source. I'm not currently going to explain the source.
It's not classified (because int was likely to speed up, I haven't verified it), and there's a wasteful loop. The first half loop (updates), the second half loop (collecting statistics), the drawing loop, and the movement simulation loop can probably be achieved within one loop (if you think about it now, the simulation speed will increase. It will be quadrupled).
The simulation takes time because it is not aimed at speeding up. In the future, I would like to do intercity simulation, but if you do so, it is better to classify and organize properly. If you write it in CUDA, it will be faster.
It is not graphed and it is difficult to give parameters flexibly. Make it a web application by linking it with someone's JavaScript.
Before the simulation, I will list the information that seems to be motivating (sources that seem to be correct). --German Chancellor Merkel "60 to 70% of the total population is infected" (https://www.nikkei.com/article/DGXMZO56691720S0A310C2000000/) --British government to revise its own new corona "herd immunity" strategy (https://www.technologyreview.jp/nl/the-uk-is-scrambling-to-correct-its-coronavirus-strategy/)
There are probably two scenarios for COVID-19 infection. ――It will eventually converge like influenza ――60 to 70% infected (until) converges So, this time, I took the position that the infection spreads until the latter herd immunity is acquired.
Some people are simulating with something like a molecular model. (The original source seems to be the Washington Post)
For the time being, it is flexible, so I tried to quantify and simulate the "rumors" that are flowing in the streets. The important parameters in this simulation are as follows.
What this model means is simply how many people will eventually be infected from the two parameters of the R0 value and the population being simulated? It just represents. You can actually find out by calculation without simulating. If the population is 1920 * 1080 = 2073600, the infection rate is 80%, the severity rate is 5%, and the sickness rate is 5% (= 0.25% case fatality rate), 4147.2 people will be killed. Influenza hospitalization and case fatality rates seem to be even lower. (https://www.hosp.med.osaka-u.ac.jp/home/hp-infect/file/ictmon/ictmon162.pdf) If you assign an infection rate of 16% and a case fatality rate of 0.001% to the same population , 3.46 people. Apart from this simulation, it is the same for all infectious diseases that the victim is predicted with a certain probability. The first point that this simulation suggests is not the number of victims, but the duration. It takes more than 300 days to converge. I used the word suggestion, but it may be correct to say that the simulation was so designed rather than suggestion.
From here on, it's a sensitive story. Even in the same event, the sacrifice that society must accept and the sacrifice that individuals cannot accept will be different. It also includes many emotional issues. For now, set it aside for simulation only. The number of beds was also taken into account in the simulation. We compare the number of bets set in advance (assuming 1/1000 of the population) with those who become severely ill, and increase the probability of losing the number of beds when the number of beds is insufficient. We are not simulating each person's symptoms. Let's compare and simulate the case where there are enough beds and the case where there are not enough beds.
When the left is insufficient and the right is abundant. The orange color of the graph is the victim. Since the number of beds is small, the number of seriously ill people will decrease by returning home silently rather than being cured, which is a rather shocking simulation result. I would like you to talk only on the simulation.
In this simulation, suppressing long-distance travel slows the spread of infection. This gentleman is a songwriter. Since the simulation is originally over 300 days, it will be gentle, but what it means is that the simulation period will take several years.
The graph above shows the number of severely ill people. By suppressing long-distance travel for 400 days (the period colored in red), we were able to create a situation where we could always secure the number of beds. The result is that it takes more than 700 days for complete convergence.
The result (on simulation) that it seems effective to suppress long-distance travel is, but I would like to make it as comfortable as possible in my life. Let's simulate with the prediction that "it will be possible by suppressing long-distance movement intermittently."
The figure above is a graph of the number of infected people. Suppression for 7,14 days has little effect. There is a clear difference in the graph at 28 days. If we did it for 400 days in a row, it could be almost flat. It also begins to show that suppression after the spread of infection is less effective. Suppression should start a little earlier.
Let's compare it with Imperial-College-COVID19-NPI-modelling-16-03-2020.pdf. Next, I will borrow the figure from pdf.
This pdf suggests ** suppression ** for 4 weeks, with 6 weeks and 2 weeks at the beginning. Let's do the same thing in this simulation.
Evaluating the results has become very difficult. Blue is the number of seriously ill people, orange is the number of people who died, and gray is the suppression period. At the top of the three graphs, the suppression was too early. The bottom was late, but it worked. It seems that suppression should be performed at ** good timing ** for an appropriate period **, and in the simulation environment here, suppression should be performed so as to cover before and after the number of severely ill persons of about 0.3% of the population. It was like. In the real world, there are too many parameters and it can be quite difficult to get the right timing.
The simulation results depend on the programmatic structure. For example, calculate different results when the start point is in the middle and when it is at the left end. It may be that geographical factors are taken into consideration, but it is still a program issue. The actual cities are continuous and the population density is not uniform, so they should be taken into account when simulating.
If the starting point is in the middle as shown in the figure, the infection spreads quickly and the damage (simulation) increases.
Last but not least, this is just a simulation. What can i say? What can be verified? It's very difficult because the actual data cannot be found accurately.
Perhaps some people are beginning to call it a "long-term battle," so I think they are simulating with accurate data somewhere in a more mathematical and analytical way. If those programs and mathematical formulas are made public and verified by multiple researchers and programmers, it will be better understood at least in terms of simulation.
Intuitively, humans move but do not move frequently, so it seems difficult to fully incorporate such human behavior mathematically. In that sense, do these programmer-like simulations make sense?
A year later, the mere simulation was a simulation. I hope I can look back with a happy feeling.
The figure is quoted from the Q & A (for the general public) regarding the new coronavirus. In the basic policy for measures against new coronavirus infection (February 25, 2nd year of Reiwa), the peak was explained as shown in the figure.
Perhaps it was supposed to be herd immunity. (I'm worried that the area of the mountain is different)
Information began to change a little after the state of emergency was declared. Information from the "Expert Meeting on Countermeasures against New Coronavirus Infections" is listed.
"We aim to reduce contact with people to at least 70% and as much as 80%." Then, as shown in the graph, the number of patients will decrease. This is not a simulation, and it seems that the number of R0 is multiplied by 0.2 (80% reduction) to show the number that it will be like this after the incubation period + the period until healing.
Looking at the achievements in Hokkaido (quoted from the Hokkaido Government), it seems that it will be flat.
I would like to keep an eye on future trends.
Recommended Posts