Updated Tue, 14 Apr 2020 09:35:45 +0000
The function fitVirus03 implements a logistic model for estimation of epidemy final size from daily predictions. The model is data-driven, so its forecast is as good as data are. Also, it is assumed that the model is a reasonable description of the one-stage epidemic. If however, the epidemic evolves to the second phase the model becomes useless. The model is also useless to the initial epidemic phase.
The contribute contains data for coronavirus for Austria, Belgium, China, Croatia, Denmark, Germany, Hungary, France, Iran, Italy, Lombardia, Norway, Netherlands, NY State, Portugal, Slovenia, South Korea, Spain, Switzerland, UK, USA and data for outside of China (up to 24.Mar.2020)
The regression convergence may fail for a pure initial guess or small data set. Therefore the method does not apply to the early stages of an epidemic. Also, results are useless if regression statistic does not meet minimum criteria, say R^2 > 0.8, p-value < 0.05.
On the epidemy evaluation graph regions colors 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)
The second figure produced is the evaluation of daily epidemy size. If these values do not converge to a constant then epidemic is probably not yet stable.
A more detailed description can be found in
Examples can be found in
A new version based on SIR model is available at
Data for other countries are available from
DISCLAIMER. Software and data are for education and not for medical or commercial use.
milan batista (2023). fitVirus (https://www.mathworks.com/matlabcentral/fileexchange/74411-fitvirus), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired: Coronavirus Tracker - Country Modeling, getDataBelgium, COVID-19 Modeling
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Add RMSE to the graph. Update data.
Change the graph layout. Update data.
Suppress invalid forecasting when the actual number of cases is greater than actual
Add data source
Add data for Denmark, Hungary, Norway, NY State
Improve initial guess. Add data for Belgium, Croatia, UK. Upgrades data for the Netherlands (thanks to Rolf Boelens)
add note about fitVirusCOVID19 program
Correct link to new version
Correct iniGuess (thanks to Nikolas Wernecke). Actual daily cases are added to the graph. R2 for total cases and infection rates are added to the summary. Data for Portugal are included.
Add note about a new version of the program (thanks to Joshua McGee)
Data and scripts for the Netherlands and USA added (thanks to Rolf Boelens)
Add link to examples
Add data for Austria
Update data. Add data for France, Switzerland
add data for Spain
add data for Germany
Update data. Add summary report to live scripts.
Remove the upper limit.
Update data. Minor changes. R2 is now included in the table.
Major revision. Remove Weibull regression, remove graph for peak time, combine graph for epidemy evaluation and its rate. Add epidemy duration and end date to report. Replace regressor A with C0. Add data for Slovenia.
Add data for Iran and out of China. Weibull regression is now optional.
Add data up to 7.Mar.2020
Correct data for South Korea
Add data for 5.Mar.2020
Correct calculation of relative error of daily predictions
Add data for Italy
Add data for 4.Mar.2020
Add data for 3 Mar 2020