We are interested in exploring the effect of “social distancing” to “spread of virus”. In particular, we wish to answer the following question: “What if some people do not follow the guideline for social distancing?” Since the society is connected to each other, we think that the effect of disobeying the social distancing might be more severe than we thought.
To check this idea, we make the following assumptions:
The population consists of two groups: One is following the social distancing. The other does not follow the social distancing. We call the former as “normal” group and the latter as “non-normal” group. Let \(W_1\) be the population proportion of the normal group and \(W_2\) be the population proportion of the non-normal group.
A person in the normal group meets \(m_1\) people daily on average. Also, a person in the non-normal group meets \(m_2\) people daily on average, where \(m_2\) is larger than \(m_1\). The actual numbers of the meetings are generated from Poisson distributions. The population average is \(m=W_1 m_1 + W_2 m_2\). We set \(m=4.4\).
If a carrir (= person with virus) meets someone at random, the virus will be tranfered with probability \(p=0.03\).
If someone get the virus then he/she will be available (without self-segregration) for ten day. After 10 days, he/she will be hospotalized.
In the first simulation, we consider three scenarios:
We compute the number of cases recursively by the following formula.
\[ Q_t = \left(C_{t-1} - C_{t - 10}\right)\left(\sum_{j = 1}^2 W_j^*n_{tj}\right) p_{t-1} \]
where initial values are
\[ C_{-8} = C_{-7} = \cdots =C_0 = 0 \]
and \(W_j^*\) and \(n_{tj}\) are
\[ W_j^* = \frac{m_jW_j}{\sum_{j= 1}^2{m_jW_j}}, \ \ \ n_{tj} \sim Poi(m_j) \]
Also, the infection probability also changes over time: \[ p_t = p_0 \left(1 - \frac{C_t}{N} \right) \]
Simulation Parameters
p_0 = 0.03 # Initial probability
N = 50000000 # Number of population
a = 10 # initial number of cases
B = 1000 # Number of Simulation
set.seed(1)
##### Complex Model ######
m = list(c(4.4), c(3, 10), c(3, 31))
w = list(c(1), c(0.8, 0.2), c(0.95, 0.05))
l = 50
res = mapply(resmat, m = m, w = w, MoreArgs = list(l = l, isSimple = FALSE))
yli = min(res[[length(m)]][[1]])
yui = max(res[[length(m)]][[1]])
colm = c(3, 2, 4, 0)
for(i in 1:length(m)){
boxplot(res[[i]][[1]], outline = FALSE, #main = sprintf("m = %g, w = %g", m[[i]], w[[i]]),
col = colm[i], log = "y", ylim = c(yli, yui), ylab = "log-scale cases", xlab = "time")
Csummary = apply(res[[i]][[1]], 2, function(x){summary(x)[2:5]})
points(1:l, Csummary["Mean",], type = "l")
legend("topleft", legend = sprintf("m = %g, w = %g", m[[i]], w[[i]]))
}
par(mfrow = c(1,1))
for(i in length(m):1){
boxplot(res[[i]][[1]], outline = FALSE,
col = colm[i], add = if(i != length(m)) TRUE else FALSE,
main = "number of cases w/ different values of m and w", log = "y", ylab = "log-scale cases", xlab = "time")
Csummary = apply(res[[i]][[1]], 2, function(x){summary(x)[2:5]})
points(1:l, Csummary["Mean",], type = "l")
}
legend("topleft", legend = paste("m=", m,"w=", w), fill = colm, cex = 1)
Each box plot represents the median, 25%, 75% quantile of the cumulative cases and the solid line represents the mean of simulated results.
# C_t; cumulative number of cases
sapply(sequence(length(m)), function(x){
apply(res[[x]][[1]], 2, function(x){summary(x)["Mean"]})
})
## [,1] [,2] [,3]
## [1,] 10.00000 10.00000 1.000000e+01
## [2,] 11.31070 11.82686 1.384738e+01
## [3,] 12.78459 14.04300 1.919471e+01
## [4,] 14.46107 16.63239 2.660584e+01
## [5,] 16.39074 19.76856 3.694127e+01
## [6,] 18.58268 23.39759 5.113935e+01
## [7,] 21.05753 27.75163 7.072856e+01
## [8,] 23.84220 32.95962 9.808159e+01
## [9,] 26.97328 39.13853 1.360711e+02
## [10,] 30.51003 46.43636 1.890271e+02
## [11,] 33.30294 53.16631 2.586733e+02
## [12,] 36.14460 60.82199 3.536247e+02
## [13,] 39.20156 69.55686 4.832465e+02
## [14,] 42.56114 79.31739 6.599279e+02
## [15,] 46.01500 90.34830 8.981439e+02
## [16,] 49.68053 102.69661 1.223551e+03
## [17,] 53.49801 116.47462 1.664918e+03
## [18,] 57.39135 132.01049 2.268301e+03
## [19,] 61.44799 149.44952 3.088430e+03
## [20,] 65.47572 168.54804 4.202746e+03
## [21,] 69.68483 190.26594 5.727279e+03
## [22,] 73.98429 214.27490 7.812510e+03
## [23,] 78.57553 241.40735 1.063732e+04
## [24,] 83.36972 271.72228 1.449791e+04
## [25,] 88.27871 305.13862 1.977731e+04
## [26,] 93.61660 342.23186 2.689704e+04
## [27,] 98.96162 383.91214 3.675466e+04
## [28,] 104.34369 430.61915 5.017698e+04
## [29,] 110.14341 482.69170 6.826366e+04
## [30,] 115.93314 541.31581 9.287770e+04
## [31,] 122.05147 606.42073 1.266673e+05
## [32,] 128.48073 679.42897 1.727073e+05
## [33,] 135.05608 761.38316 2.345615e+05
## [34,] 141.81356 853.30550 3.183563e+05
## [35,] 148.85399 954.80860 4.324352e+05
## [36,] 156.02105 1070.30369 5.872461e+05
## [37,] 163.56219 1196.87993 7.964382e+05
## [38,] 171.37307 1339.98653 1.079610e+06
## [39,] 179.35982 1498.86696 1.460942e+06
## [40,] 187.81436 1674.10623 1.974924e+06
## [41,] 196.40267 1868.85313 2.653908e+06
## [42,] 205.60729 2085.51436 3.553834e+06
## [43,] 214.58563 2329.99521 4.729330e+06
## [44,] 224.45517 2607.21433 6.264454e+06
## [45,] 234.29028 2915.29653 8.211535e+06
## [46,] 244.51011 3257.67781 1.063363e+07
## [47,] 255.22960 3638.87324 1.353968e+07
## [48,] 266.16251 4071.92587 1.693918e+07
## [49,] 277.65303 4550.99143 2.072885e+07
## [50,] 289.33603 5082.92722 2.484114e+07
At each row, the expected numbers of total cases are presented for each scenario.
We also consider other scenarios for the 5% outlier groups:
##### Complex Model ######
m = list(c(3, 30), c(5, 10), c(3, 20))
w = list(c(0.99, 0.01), c(0.95, 0.05), c(0.95, 0.05))
l = 50
res = mapply(resmat, m = m, w = w, MoreArgs = list(l = l, isSimple = FALSE))
yli = min(res[[length(m)]][[1]])
yui = max(res[[length(m)]][[1]])
colm = c(3, 2, 4, 0)
for(i in 1:length(m)){
boxplot(res[[i]][[1]], outline = FALSE, #main = sprintf("m = %g, w = %g", m[[i]], w[[i]]),
col = colm[i], log = "y", ylim = c(yli, yui), ylab = "log-scale cases", xlab = "time")
Csummary = apply(res[[i]][[1]], 2, function(x){summary(x)[2:5]})
points(1:l, Csummary["Mean",], type = "l")
legend("topleft", legend = sprintf("m = %g, w = %g", m[[i]], w[[i]]))
}
par(mfrow = c(1,1))
for(i in length(m):1){
boxplot(res[[i]][[1]], outline = FALSE,
col = colm[i], add = if(i != length(m)) TRUE else FALSE,
main = "number of cases w/ different values of m and w", log = "y", ylab = "log-scale cases", xlab = "time")
Csummary = apply(res[[i]][[1]], 2, function(x){summary(x)[2:5]})
points(1:l, Csummary["Mean",], type = "l")
}
legend("topleft", legend = paste("m=", m,"w=", w), fill = colm, cex = 1)
Each box plot represents the median, 25%, 75% quantile of the cumulative cases and the solid line represents the mean of simulated results.
# C_t; cumulative number of cases
sapply(sequence(length(m)), function(x){
apply(res[[x]][[1]], 2, function(x){summary(x)["Mean"]})
})
## [,1] [,2] [,3]
## [1,] 10.00000 10.00000 10.00000
## [2,] 11.64691 11.64154 12.19817
## [3,] 13.54720 13.52920 14.88076
## [4,] 15.77245 15.74376 18.21144
## [5,] 18.31728 18.35275 22.22590
## [6,] 21.32774 21.38052 27.12713
## [7,] 24.81731 24.90517 33.12132
## [8,] 28.87238 29.04948 40.50012
## [9,] 33.51660 33.70933 49.60793
## [10,] 39.01048 39.29479 60.68669
## [11,] 43.74628 44.17294 72.00421
## [12,] 49.02957 49.53764 85.20119
## [13,] 54.83341 55.41432 100.93959
## [14,] 61.20365 61.97356 119.25853
## [15,] 68.26214 69.12290 140.84221
## [16,] 75.92823 76.95933 166.05466
## [17,] 84.26204 85.51983 195.67648
## [18,] 93.37559 94.92948 230.43942
## [19,] 103.38551 104.84897 270.85706
## [20,] 114.04453 115.69599 317.52695
## [21,] 125.83909 127.49901 372.43305
## [22,] 138.42739 140.32563 436.82193
## [23,] 152.28831 154.54605 511.06729
## [24,] 167.22913 170.28561 597.85835
## [25,] 183.46060 187.12675 700.41612
## [26,] 201.08438 205.17820 820.45671
## [27,] 220.24249 224.74585 958.33928
## [28,] 241.19425 246.29622 1120.46910
## [29,] 264.08343 269.29116 1310.52808
## [30,] 288.55907 294.50692 1532.14482
## [31,] 315.21346 321.90641 1785.14406
## [32,] 344.30926 351.05699 2085.44398
## [33,] 375.82131 382.85723 2435.04830
## [34,] 410.27385 418.14378 2843.74335
## [35,] 447.22578 455.75022 3322.07659
## [36,] 487.15218 497.44123 3875.48344
## [37,] 531.61434 543.08111 4521.63686
## [38,] 579.67300 592.31657 5278.73166
## [39,] 631.36705 645.63976 6155.94086
## [40,] 688.51652 704.76837 7189.19816
## [41,] 748.61709 767.97750 8404.07102
## [42,] 815.30020 836.54767 9814.11096
## [43,] 888.69548 910.13925 11419.65936
## [44,] 967.26958 989.22339 13325.75059
## [45,] 1052.41680 1074.09801 15560.53027
## [46,] 1144.16016 1170.61506 18148.61975
## [47,] 1245.10064 1272.07110 21200.68291
## [48,] 1354.25982 1385.63197 24753.79771
## [49,] 1470.83192 1505.75411 28933.47531
## [50,] 1598.91414 1640.83817 33703.28541
Social distancing is critical!