No longer actively maintained. I am too lazy to keep it working all the time. Sorry. Please use the official page - Onemocneni aktualne MZCR
Mathematical prediction of COVID-19 pandemic's development. Fetching data from czech-covid-db and Johns Hopkins University COVID-19 repository. Everything is downloaded and calculated on the client side. This project has no server side, except the program that updates czech-covid-db.
If you want the data in JSON format, open your browser's developer console and type one of these commands:
- tests:
console.log(JSON.stringify(datasets.tests, null, 1))
- confirmed cases:
console.log(JSON.stringify(datasets.confirmed, null, 1))
- recovered:
console.log(JSON.stringify(datasets.recovered, null, 1))
- deaths:
console.log(JSON.stringify(datasets.deaths, null, 1))
- growth factor:
console.log(JSON.stringify(datasets.spreadGrowthFactor, null, 1))
- prediction:
console.log(JSON.stringify(datasets.prediction, null, 1))
- Chart.js for visualisation
- Moment.js for easy date/time manipulation
- PapaParse for csv parsing (they say it's faster than string splitting, but idk)
- NProgress for the loading bar at top
Explanation of the function is in about. Here is how the code for it works.
The prediction dataset is created in function calculatePredictions()
. There are many lines in the function that provide the growth factor (MtimesP
) it has to use and other things depending on user configuration. The essential parts are these:
- The loop. One iteration calculates a result for one day.
while(lastResult <= populationSize && Math.round(lastResult) != Math.round(resultBeforeInfectionPeriod) ){
In the loop, one of these calculations happen:- If selected function is Henry's logistic/first:
result = lastResult + MtimesP*(1-(lastResult/populationSize))*(lastResult-resultBeforeInfectionPeriod);
- If it is the other function (Henry's probabilistic),
MtimesP
is converted tomeetInThisDay
, thenresult = populationSize*(1 - (1-lastResult/populationSize)*Math.pow((1- probabilisticProbability*(lastResult-resultBeforeInfectionPeriod)/populationSize),meetInThisDay));
- If selected function is Henry's logistic/first: