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:
fitVirusCV19_state('Massachusetts','plt','on')
The plot may be enabled or disabled via (default is on):
fitVirusCV19_state('Massachusetts','prn','on')
To plot the growth rate on the figure use (def value is 2)
fitVirusCV19_state('Massachusetts','nsp',3)
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
JM2 (2021). 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 .
Inspired by: CoronavirusDataByState, URL Read Table, fitVirusCOVID19
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Thanks! In order to get this to work on 2018a, I needed to modify urlreadtable, line 60 to be:
aux = (regexprep(mytable{z}{1,:},'\W',''))