The COVID survival calculator

Trading is obviously affected by global pandemics. Not only because markets tank whenever a new virus variant emerges. It’s also personal. After all, if you know that you have only a few months before you likely die, you might be motivated to trade a little more risky. To help you with this decision, I’m publishing here a Zorro script that calculates your average survival time depending on the COVID incidence in your country and on your vaccination status.

The algorithm is plain math, based on three variables: The vaccination percentage of your country, the vaccination percentage among cases, and the 7-day incidence, i.e. the number of cases per week and per 100,000 people.  ‘Case’ can be infection, hospitalization, or death, dependent on what result you want to calculate. Those 3 variables are often available from health organizations in most countries, or can be derived from publicly available statistics. The script calculates the vaccinated and unvaccinated incidences and the average survival time in weeks before a vaccinated or unvaccinated person is infected, hospitalized, or dead. It makes no assumptions about the effectivity of vaccinations.

First, incidence calculation. Let’s assume that your country has a total 7-day incidence of 400, and that 70% of people, and 35% of the infected are vaccinated. The incidence of the vaccinated is then:

Ivac = 400 * 35/70 = 200

The incidence of the unvaccinated:

Iunv = 400 * (100-35)/(100-70) = 867

Thus, in that hypothetical case you’re four times more likely to catch the virus when you’re unvaccinated – despite the relatively high 35% vaccinated infection rate. But what does this mean for your survival time?

The probability P to survive a week without becoming a ‘case’ depends on incidence I:

P = 1-I/100000

The chance to survive N weeks is thus

(1-I/100000)N

The half life – the time T in weeks until 50% of people are infected – is given by

T = ln(0.5)/ln(P)

When we enter the above figures, first for the vaccinated:

T = ln(0.5)/ln(1-200/100000) = 346 weeks

Then for the unvaccinated:

T = ln(0.5)/ln(1-867/100000) = 80 weeks

Thus, in the given scenario most of the unvaccinated will be either dead or recovered within two years. Of course under the assumption that the incidence does not change during that time. We know that this is not the case: due to the exponential spread, pandemics tend to come and go in waves, as in the above image. Therefore, in the case of COVID, use not the current incidence, but the  average incidence from top to valley of the most recent wave for estimating your average survival time.

The script in C for Zorro:

// Covid Vaxxed vs Unvaxxed survival calculator ///////////////////////////

void click(int Row,int Col)
{
	if(Row != -1) return; // [Result] clicked?
	sound("click.wav");
	printf("\nTotal: Vaxx %.0f%% Unvaxx %.0f%%",
		slider(1),100-slider(1));
	printf("\nCases: Vaxx %.0f%% Unvaxx %.0f%%",
		slider(2),100-slider(2));
	var Vaxx = slider(3)*slider(2)/slider(1);
	var Unvaxx = slider(3)*(100-slider(2))/(100-slider(1));
	printf("\nIncidence: Vaxx %.0f Unvaxx %.0f",
		Vaxx,Unvaxx);
	printf("\nRisk/week: Vaxx %.2f%% Unvaxx %.2f%%",
		Vaxx/1000,Unvaxx/1000);
	printf("\nSurvival/weeks: Vaxx %.0f Unvaxx %.0f",
		log(0.5)/log(1.-Vaxx/100000),
		log(0.5)/log(1.-Unvaxx/100000));
	printf("\n");
}

void main()
{
	slider(1,70,1,99,"Total %","Vaccinated in population");
	slider(2,30,1,99,"Cases %","Vaccinated cases");
	slider(3,1000,1,2000,"Incidence","Weekly cases per 100,000"); 
	while(wait(100)); // keep script alive
}

Start the script and set up the 3 sliders to:

  • the total vaccination percentage in the population,
  • the vaccination percentage of cases,
  • the 7-day per 100,000 case incidence.

Then click on [Result]. The printout should look like this:

Total: Vaxx 70% Unvaxx 30%
Cases: Vaxx 35% Unvaxx 65%
Incidence: Vaxx 200 Unvaxx 867
Risk/week: Vaxx 0.20% Unvaxx 0.87%
Survival/weeks: Vaxx 346 Unvaxx 80

The script can be downloaded from the 2021 repository. Zorro can be downloaded from zorro-project.com