File Exchange

image thumbnail

COVID19 Data Fitting with Linear and Nonlinear Regression

version 1.0.3 (3.48 MB) by Lorand Gabriel Parajdi
Linear, exponential, logistic, Gompertz, Gauss, Fourier models fitted to epidemiological data from the COVID-19 outbreak.


Updated 19 Aug 2020

View Version History

View License

A collection of tools for fitting several general-purpose linear and nonlinear models for COVID-19 epidemiological data. The longitudinal data is obtained from the John Hopkins database (source: and consists of: number of active cases, number of confirmed, number of fatalities, number of recovered cases. The analysis is possible for any particular country listed in the database, or for the world data as a whole. The models implemented include linear, exponential, logistic, Gompertz, fifth-degree polynomial, Gaussians and Fourier functions. The three models of the Bertalanffy class (exponential, proper logistic and Gompertz) afford a reasonable balance between reduced model complexity and goodness of fit. We implement data/model visualization in linear and logarithmic scales, for easy model comparisons.

Cite As

Lorand Gabriel Parajdi and Ioan Stefan Haplea (2020). COVID19 Data Fitting with Linear and Nonlinear Regression (, MATLAB Central File Exchange. Retrieved April 15, 2020.

Comments and Ratings (3)

Hi, I was getting an error in the examples but I deleted 'str2double' from this variable data_mat = str2double( table2array( T(index_location, 5:end) ) ) in every funtion an it works. Thank you so much for share your work, it helps me a lot.

Thank you for the interest in our Matlab package. We were unable to replicate the error you mentioned, but we do not have access to Matlab 2020. We tested the package on v2016a and v2019a only. We have rewritten the functions that fetch and process the data from the database. We avoided the reshape() function which caused the error and hopefully made the code more future-proof.
We would be very grateful If you could test on your platform the new functions and give us feedback.

Eugene Gallagher

With Matlab 2020a, I'm getting an error in all of the *.mlx files when calling reshape
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in get_global (line 14)
m = reshape(tn, lin, col);

MATLAB Release Compatibility
Created with R2019a
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!