COVID-19 Modeling

version 3.6.3 (2.73 MB) by Joshua McGee
This model was created based off of fitVirus. This is a data-driven model that obtains up to date data and predicts the spread of COVID-19.


Updated 3 May 2020

View License

Created to track the simulate the spread of Coronavirus (COVID-19). Case data is obtained over the web and fitted to a logistic model to predict epidemic spread over time.

To operate load the folder containing the script COVID19Modelingv2 and type the following code in the command prompt: COVID19Modelingv2("country").
example: COVID19Modelingv2("US"). Multiple countries can be analyzed at the same time by placing them in a list: COVID19Modelingv2("US","Italy").

The model was created by Milan Batista (fitVirus). The model is a data-driven model that fits epidemic data to a logistic curve. The goal of the model is to make local predictions about the viral spread and epidemic duration. The model can be used to provide accurate approximations in certain situations. "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 the regression statistic does not meet minimum criteria, say R^2 > 0.8, p-value < 0.05." (Milan Batista)

DISCLAIMER: Model will fail in certain situations. A rigorous statistical analysis should be performed on all results. The model fails when additional epidemic stages (not described by logistic function) are encountered. Use at your own discretion.

See for more info:

Data is stored online and is provided via JHU CSSE from various sources including:
"The World Health Organization (WHO), Pneumonia. 2020, BNO News,
National Health Commission of the People? Republic of China (NHC),
China CDC (CCDC), Hong Kong Department of Health, Macau Government, Taiwan CDC, US CDC, Government of Canada, Australia Government Department of Health, European Centre for Disease Prevention and Control (ECDC) and Ministry of Health Singapore (MOH)"

On the figure, the epidemic rate is plotted with a blue line (cases/day). Blue dots are the actual infection rate (cases/day). Region colors separate epidemic transition phases:
red - fast growth phase
yellow - transition to steady-state phase
green - ending phase

Cite As

Joshua McGee (2022). COVID-19 Modeling (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with R2019b and later releases
Platform Compatibility
Windows macOS Linux

Inspired by: fitVirus

Inspired: Coronavirus Tracker - Country Modeling

Community Treasure Hunt

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

Start Hunting!