Introduction
2 facts about the pandemic: the first is that masks do help. The second is that testing efficiency is crucial in controlling the disease due to the distinct feature of the virus that most infected are asymptomatic. The first fact is easily measurable by measuring its effect on $R_0$. The second fact however is not.
The constant $R_0$ is largely autonomous which is independent of nation parameters and current status but hygienic condition. Testing efficiency depends on amount of (reliable) testing kits you can get, which varies a lot among countries and in different time.
In order to investigate this we would like to plot testing efficiency against positive rate because we can divide the pandemic within a country into stages.
(I was inspired by the typhoon kinetic energy vs max wind plot. That was studied in a completely different way though...)
The parameters
Horizontal axis: log(daily test count)
Vertical axis: Daily confirmed cases/daily test count
We collect data from [1] and show some plots for countries with 50+ confirmed cases for more than 15 days (with the exception for some countries whose started announcing their test count very early on).
The daily count is smoothed by taking a 7-day average instead, to average out the weekly fluctuation.
The stages
If we plot log(testing capability) against positive rate we can observe the following stages:
Stage 0 - the isolation period. No signs of uncontrolled outbreak. Testing efficiency varies due to global trends in different time.
Costa Rica: isolated case from time to time and the virus never really rooted in the nation.
Taiwan: the country that did the best really. Fully masked citizens (with sufficient and affordable masks) and proper quarantine policies. Most cases are imported and identified immediately.
Character on the plot: wandering around and affected by random events rather than the exponential trend.
Stage 1 - the outbreak period. Testing capability expands but can't keep up with the growth in suspected cases so positive rate grows as well.
Typical examples as of now: part of South America (Brazil, Mexico), Russia
The most recent outbreak occurs in Brazil but they provide no testing data so I picked Hungary and Mexico here.
Character on the plot: as the positive count grows exponentially the testing capability simply cannot keep up with the growth. That results in a raise (kind of log-linear) in both testing scale and positive rate.
Stage 2 - the peak period. The testing capability is now able to keep up with the urgent needs. It stays steadily on the graph.
Typical examples as of now: part of South America, US
Character on the plot: the testing capability expands to the point the infection rate is primarily control and peaks for a while. On the plot it wanders around for a moment.
Stage 3 - the expand detection period. The reduction in new patients allow countries to put their effort on testing less suspected cases. The amount of confirmed cases may peak as much as the previous stage but the positive rate will drop while testing count increases. The curve on the graph drops along an "isotherm" that represents a given number of daily confirmed cases.
Typical examples as of now: Europe and Southeast Asia
Character on the plot: the testing capability expands further that more asymptomatic patients are identified. The curve first slides along an "isotherm" that represents a constant number of daily positive case then drop further. (From here we can see that the positive rate is in some sense a leading indicator than the positive rate!)
Stage 4 - the elimination period. By picking out most asymptomatic patients the spreading speed of the virus is greatly reduced. Countries may reduce their testing speed slightly with positive rate also dropping to a very low rate.
New Zealand: she did a marvelous job by announcing a decisive lockdown very early with citizens closely following the rules.
South Korea: after the initial outbreak, South Korea is one of the countries that applied large scaled quick testing. Together with high-tech tracing they successfully (almost) eradicated the virus. KBO is opening soon, too!
Character on the plot: when the daily new case drops drastically the testing pressure is reduced greatly. The testing target turns to the general public, but it will not be as frequent as before.
The large countries
First let us look at the plot for large countries. As you can see from the stage 2 graph the testing scale is affected by the population but there is not a simple way to scale it down -- it depends on the wealth, technological level and governance controlibility of the nation. So for now a better way to look at that is to compare just the large countries.
Canada: Stage 1-2? Not heavily infected yet, but worries are there an outbreak may occur anytime as the right climate is arriving.
Turkey: Stage 2-3. The outbreak almost peaked and should go down soon.
US: Stage 2. Due to population distribution we can hardly say the whole country is in a similar state. New York is definitely improving but some other states are still in bad form. The overall count seemed to be stabilized anyhow.
Russia: Stage 1. That is the most interesting case. They started large scale detection early on...yet they failed to prevent an outbreak. To this there are several explanations. First the testing accuracy may not be as good as the wealthy western European nations (although the kits are mostly from China anyway...). Secondly they may not be testing the right people -- most tests are conducted in the densely populated cities, but the patients simply spread the virus from its western border which is too hard to "defend". It is rather easy to close the Russia-China border, but closing border on the west is extremely hard.
The outliers
Most countries followed this pattern, except for a few. The two main outliers are UK and Japan:
UK(aka the herd immunity): Stage 1. Yeah we now know that herd immunity is a joke and the government never really tried to implement that. However they are being dragged down by their inefficient NHS system -- they are not able to transform into a state-of-war medical system. They are also not expanding their testing capability enough. Sick people are simply asked to stay home unless their feel like they are going to suffocate. Hidden patients simple floating around the whole city and spreading virus swiftly. Although with lockdown already announced, the case count may not grow like Italy [see the stage 3 graph] -- but it is just the official number. The horribly high positive rate is sampled from seriously sick patients, hinting that the actual infected count is a lot higher. God knows when will it ends?
Japan(aka the Olympic host): Stage 1-2. They are finally willing to act a bit more after announcing the delay of the Tokyo Olympics. It is however too little too late, as the virus is already spreading independently in most large cities. Japan is also one of the few countries who is not willing to test widely, due to social pressure rather than government policy. They seemed to have controlled the spreading partially, after finally being able to shoo officers away from commuting alongside with partial lockdown and emergency state declaration. They also have better hygiene in general comparing with Europeans so the situation is apparently better -- until the uncontrollable outbreak begins.
Conclusion
So, are there anything we can tell from this plot?
- Testing more is an effective way controlling the outbreak. First on the suspects or people that had direct contact with confirmed patients, then on the sick during outbreak, and lastly on general population to eliminate.
- There aren't many countries that did not expand the testing scheme for those providing data. UK and Japan are in fact the only two -- UK is in a very bad state; Japan is worsening but they seemed to gained a little control with multiple alternate measures.
- This plot is a leading indicator comparing with the confirmed count and even more with the death count. However it gives less of a clue on when the peak period is over.
- The plot will be a stronger indicator if one manages to normalize the confirmed count by countries' capability, condition and population. In such way we can standardize and define clearly the classification of stages. The stages are still clear by identifying their shape though.
At least we feel happy that most countries are willing to test more, and adopting correct measures like lockdown, applying social distance and wearing masks, unlike what WHO claimed.
Well, that's all for me today. I hope everyone is safe during the lockdown again.
Reference:
[1] Total confirmed cases vs total tests conducted, retrieved 17 Apr 2020.
Thursday, 23 April 2020
Monday, 30 March 2020
Calculating area enclosed by intersections
A small math question today.
Given a unit sphere and an arbitrary ellipsoid, calculate the surface area of sphere inside the ellipsoid.
Without loss of generality, we may assume the unit sphere to be centered at origin, then the question depends solely on the 6 parameters defining the ellipsoid, $c_i, \alpha_i$ for $i=1,2,3$ in $\sum (x_i-c_i)^2/\alpha _i ^2 = 1$. Without thinking too much about existence of analytic solution in terms of the parameters, we want to look for ways to calculate or at least approximate the problem.
My own solution is based on the famous Gauss-Bonnet theorem:
$\int _M KdA + \int _{\partial M} \kappa _g ds = 2\pi \chi (M)$
The curvature of a unit sphere is constantly 1, and the Euler characteristic of a disc is 1. As long as you can calculate the geodesic curvature you get
$|M| = 2\pi - \int _{\partial M} \kappa _g ds$.
The intersection is a union of finitely many closed curves we can just calculate one by one.
A simple example would be as follows:
Consider the intersection between $x^2+y^2+z^2=1$ and $(x-1)^2+y^2+z^2=1$. The intersection $\Gamma$ is given by $x = \frac{1}{2}$ and $y^2+z^2 = \frac{3}{4}$. This is a circle of radius $\frac{\sqrt{3}}{2}$ with geodesic curvature $\frac{1}{\sqrt{3}}$. Therefore we have $\int _{\Gamma} \kappa _g ds = \pi$, so $|A| = 2\pi \pm \pi$ depending on the orientation. The surface area can be verified using the formula from Archimedes $|A| = \pi (h^2+a^2)$.
*
Of course, obtaining the parametrization is sometimes too difficult. Are there any easier ways to approximate the answer? Here are two suggestions from my friends.
- Monte Carlo based: sample points on the surface of the sphere and check whether it is in the ellipsoid.
- Integral approximation: similar to Monte Carlo but instead we split the sphere into pieces using spherical coordinates, then the required area is the integral over the indicator function of the ellipsoid.
And of course we can get an estimation using the Gauss-Bonnet approach. Let us call the sphere $S$ and the ellipsoid $E$. We start from a point of intersection, say $x$. The curve goes in the direction $v\in T_xS \cap T_xE$, the intersection of the tangent spaces of the two objects at $x$. We know the intersection must be of dimension 1 because if the two objects are cotangent at the point then the intersection is a point which generates no area after all.
Obtaining this direction is simply algebra, where we find the intersection between two subspace. With this direction we can numerically obtain a closed curve. There is a gap here because we may not go back to the starting point using numerical approximation. We just assume by smoothness (well sphere and ellipsoid are very nice objects) by doing fine enough approximation things would work (actually I believe we can prove this but I am not an expert in numerical methods) -- then we have an approximated curve of intersection.
From here we can calculate its length as well as its geodesic curvature, and the estimated area follows.
Gauss-Bonnet seems quite universal even if we generalize sphere and ellipsoid to other bounded closed $C^{\infty}$ objects because they are manifolds anyway. The only worry being whether we can get a closed curve without any global features that promises convergence.
*
Well this is just a funny little problem that I enjoyed during the lockdown. I feel like I should write some maths before I go back to my creation whether it is literature, music or research.
Meanwhile I hope everyone is alright during the pandemic -- whether you call it COVID-19, or Wuhan virus. Stay indoor, and stay healthy.
Given a unit sphere and an arbitrary ellipsoid, calculate the surface area of sphere inside the ellipsoid.
Without loss of generality, we may assume the unit sphere to be centered at origin, then the question depends solely on the 6 parameters defining the ellipsoid, $c_i, \alpha_i$ for $i=1,2,3$ in $\sum (x_i-c_i)^2/\alpha _i ^2 = 1$. Without thinking too much about existence of analytic solution in terms of the parameters, we want to look for ways to calculate or at least approximate the problem.
My own solution is based on the famous Gauss-Bonnet theorem:
$\int _M KdA + \int _{\partial M} \kappa _g ds = 2\pi \chi (M)$
The curvature of a unit sphere is constantly 1, and the Euler characteristic of a disc is 1. As long as you can calculate the geodesic curvature you get
$|M| = 2\pi - \int _{\partial M} \kappa _g ds$.
The intersection is a union of finitely many closed curves we can just calculate one by one.
A simple example would be as follows:
Consider the intersection between $x^2+y^2+z^2=1$ and $(x-1)^2+y^2+z^2=1$. The intersection $\Gamma$ is given by $x = \frac{1}{2}$ and $y^2+z^2 = \frac{3}{4}$. This is a circle of radius $\frac{\sqrt{3}}{2}$ with geodesic curvature $\frac{1}{\sqrt{3}}$. Therefore we have $\int _{\Gamma} \kappa _g ds = \pi$, so $|A| = 2\pi \pm \pi$ depending on the orientation. The surface area can be verified using the formula from Archimedes $|A| = \pi (h^2+a^2)$.
*
Of course, obtaining the parametrization is sometimes too difficult. Are there any easier ways to approximate the answer? Here are two suggestions from my friends.
- Monte Carlo based: sample points on the surface of the sphere and check whether it is in the ellipsoid.
- Integral approximation: similar to Monte Carlo but instead we split the sphere into pieces using spherical coordinates, then the required area is the integral over the indicator function of the ellipsoid.
And of course we can get an estimation using the Gauss-Bonnet approach. Let us call the sphere $S$ and the ellipsoid $E$. We start from a point of intersection, say $x$. The curve goes in the direction $v\in T_xS \cap T_xE$, the intersection of the tangent spaces of the two objects at $x$. We know the intersection must be of dimension 1 because if the two objects are cotangent at the point then the intersection is a point which generates no area after all.
Obtaining this direction is simply algebra, where we find the intersection between two subspace. With this direction we can numerically obtain a closed curve. There is a gap here because we may not go back to the starting point using numerical approximation. We just assume by smoothness (well sphere and ellipsoid are very nice objects) by doing fine enough approximation things would work (actually I believe we can prove this but I am not an expert in numerical methods) -- then we have an approximated curve of intersection.
From here we can calculate its length as well as its geodesic curvature, and the estimated area follows.
Gauss-Bonnet seems quite universal even if we generalize sphere and ellipsoid to other bounded closed $C^{\infty}$ objects because they are manifolds anyway. The only worry being whether we can get a closed curve without any global features that promises convergence.
*
Well this is just a funny little problem that I enjoyed during the lockdown. I feel like I should write some maths before I go back to my creation whether it is literature, music or research.
Meanwhile I hope everyone is alright during the pandemic -- whether you call it COVID-19, or Wuhan virus. Stay indoor, and stay healthy.
Subscribe to:
Posts (Atom)







