File Exchange

image thumbnail

fitVirusCOVID19

version 5.2.1 (8.04 MB) by milan batista
Estimation of coronavirus COVID-19 epidemic evaluation by the SIR model

5.1K Downloads

Updated 12 May 2020

View License

The function fitVirusCV19 implements the susceptible-infected-removed (SIR) epidemic model for the estimation of epidemy evaluation. It is assumed that the model is a reasonable description of the one-stage epidemic. In particular, the model assumes a constant population, uniform mixing of the people, and equally likely removalof infected. The model is data-driven, so its forecast is as good as data are. The forecasting change with new or changed data. The officially declared outbreak of the epidemic and the outbreak of the epidemic as it reported by the program have nothing to do with each other. The program indicates the start date when the data is sufficient to calculate the initial approximation.

For those who are not familiar with epidemic models, we suggest the following articles: https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiolog,
http://www.maths.usyd.edu.au/u/marym/populations/hethcote.pdf , and https://web.stanford.edu/~jhj1/teachingdocs/Jones-on-R0.pdf.

The parameters of the model are obtained by minimization of the objective function, which is the sum of squares for residuals of values and sum of squares for residuals of values differences. The weights of summands are selected automatically. Optimization Toolbox function fminsearch is used to calculate optimal values of unknown model parameters. If the calculation fails then only data are plotted.

The contribute contains data for coronavirus for Argentina, Austria, Belgium, Brazil, Canada, Croatia, China, Czech Republic, Denmark, Germany, Hungary, France, Iceland, India, Indonesia, Iran, Italy, Japan, Netherlands, Norway, Poland, Portugal, Romania, Russia, Slovakia, Serbia, Slovenia, South Korea, Spain, Switzerland, Turkey, UK, USA and World (up to 28.April.2020)

On the epidemy evaluation graph, regions color separate epidemy phases (these are not standard but arbitrarily chosen for convenience):
red - fast growth phase
yellow - transition to steady-state phase
green - ending phase (plateau stage)

On the total cases graph, margins are +/-3*RMSE; on daily new cases graph, margins are +/dRMSE.

On Daily Cases Growth Factor graph two lines 1% (green) and 5% (red) are shown only for orientation reason.

Results are saved in structure res (see function fiVirusCV19 header). Optionally the results may be printed by

fitVirusCV19(@getDataXXX,'prn','on')

where XXX stands for the country name. When regression fails then only data are plotted. Population size is limited to 12 Mio. You can change the upper limit by name/value pair:

fitVirusCV19(@getDataXXX,'nmax',nmax)

Use this option if the final prediction is too high or exceed the country's population.

To exclude growth rate from the graph on the figure use (def value is 3)

fitVirusCV19(@getDataXXX,'nsp',2)

Function analyseCV plots a graph of evaluation of contact number (sigma), Cend (epidemic size), N (initial susceptible population size). To analyze data for country XXX from 10 days of epidemic onward use

analyseCV19(@getDataXXX,10)

DISCLAIMER: Software and data are for education and not for medical or commercial use. The model may fail in some situations. In particular, the model may be inadequate; the model may fail in the initial phase and in when additional epidemic stages or outbreaks (not described by SIR model) are encountered. Use it at your own discretion.
The data are only for demonstrating the operation of fitVirusCV19. FitVirus and presented demo data are only for educational and academic purposes and should not be used for medical purposes and in commerce. They are provided as is and any express or implied warranties, including but not limited to implied warranties of merchantability and fitness for a particular purpose are disclaimed.

Source of data
https://ourworldindata.org/coronavirus-source-data.
https://www.worldometers.info/coronavirus/coronavirus-cases/#case-tot-outchina
https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic_by_country_and_territory
An actual source of data is for each country reported in the corresponding getData function.

NEW: importTotalCases function read and generate data from <ourworldindata> data file (by Igor Podlubny )

A more detailed description can be found in
https://www.researchgate.net/publication/339311383_Estimation_of_the_final_size_of_the_coronavirus_epidemic_by_the_SIR_model
Examples can be found in
https://www.researchgate.net/publication/339912313_Forecasting_of_final_COVID-19_epidemic_size_200318

Cite As

milan batista (2021). fitVirusCOVID19 (https://www.mathworks.com/matlabcentral/fileexchange/74658-fitviruscovid19), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

fitVirusCV19_v07_v18

fitVirusCV19_v07_v18/CV19

fitVirusCV19_v07_v18/PLA

fitVirusCV19_v07_v18/data