This code will retrieve recent state-level data from Wikipedia and attempts to fit it to a SIR model using structure created by Milan Batista.(https://www.mathworks.com/matlabcentral/fileexchange/74658-fitviruscovid19?s_tid=prof_contriblnk). 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.
Results are saved in structure res (see function fiVirusCV19_state header). Optionally the results may be printed by:
The plot may be enabled or disabled via (default is on):
To plot the growth rate on the figure use (def value is 2)
A more detailed description can be found in:
Examples can be found in:
Joshua McGee (2023). fitVirusCV19_state (United States COVID-19 SIR Model) (https://www.mathworks.com/matlabcentral/fileexchange/74813-fitviruscv19_state-united-states-covid-19-sir-model), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
-added notes and updated data 4/15
updated small fixes 4/14
updated 4/13, small bug fixes, an added table displaying summary statistics for each state
-bug fixes and updates 4/12
-updates and small fixes
-small updates and corrections
-updated data 4/3
-added graphs for states that do not fit SIR model well to at least show data trends over time
-cleaned up data to give better predictions
-added end date to plots
-updated examples with new data