File Exchange

image thumbnail

estimate_R

version 1.1.2 (2.71 MB) by milan batista
MATLAB translation of R function estimate_R for estimates the reproduction number of an epidemic from the package EpiEstim.

11 Downloads

Updated 04 Aug 2020

View License

estimate_R calculates the reproduction number of an epidemics. It is MATLAB translation of R function estimate_R from package EpiEstim, ver 2.2-3. In the translation, the original structure of the functions and their names was preserved as far as possible, so that the EpiEstim reference manual can be used (A.Cori et al., Package EpiEstim)

Three methods are currently supported: 'parametric_si', 'non-parametric_s' and 'uncertain_s'.

The following are user functions:
funMeFirst.m set paths
runCountry.m run estimation for selected country and plot results.
runEU.m scan EU countries and write R, IR and AR to EU_DDMMYYYY.csv file.
runWorld.m scan complete data set stored in the 'data' folder

Data for various countris can be obtained by running the function importDataWM.m. This functionwill read data from the <worldometers.info> website and store them to folder 'data'.

Function importData(country,start_date) colect data for specified country and store them into 'AppData' object, which can be use as input to estimate_R. Examples:

slo = importData('Slovenia',[]);
res = estimate_R(slo,___)

slo = importData('Slovenia',[2020,6,1]);
res = estimate_R(slo,___)

NOTE 1: Double-quoted strings in R must be changed to a MATLAB column. For example: "parametric_si" should be used as "parammetric_si.

NOTE2: Some new options have been added to the chart function (for details see folder @estimate_R / plot.m). In particular options for incidence, R, and serial interval plot are controlled by options class. Some new properties are added: plot_type, title, extend_title. Plot types for incidence plot and serial interval plot include 'line', 'bar', 'stairs','scatter' and for SI plot also 'area'.

NOTE 3: Option wind_len is added to make_config function to set sliding window size (see make_config.m)

NOTE4: Incidence rate (obj.IR) and attack rate (obj.AR) are calculated if user provide population. IR can then be add to the plot with plot with plot(__,'what',['IR',...],...)

For a detailed description of the algorithms see:
Anne Cori, Neil M. Ferguson, Christophe Fraser, Simon Cauchemez , A New Framework and Software to Estimate Time-Varying Reproduction Numbers During Epidemics, American Journal of Epidemiology, Volume 178, Issue 9, 1 November 2013, Pages 1505–1512, https://doi.org/10.1093/aje/kwt133
R.N. Thompson, J.E. Stockwin, R.D. van Gaalen, J.A. Polonsky, Z.N. Kamvar, P.A. Demarsh, E. Dahlqwist, S. Li, E. Miguel, T. Jombart, J. Lessler, S. Cauchemez, A. Cori, Improved inference of time-varying reproduction numbers during infectious disease outbreaks, Epidemics, Volume 29, 2019, https://doi.org/10.1016/j.epidem.2019.100356.

For data on serial interval see:
Hiroshi Nishiura, Natalie M Linton, Andrei R. Akhmetzhanov, Serial interval of novel coronavirus (2019-nCoV) infections, https://www.medrxiv.org/content/10.1101/2020.02.03.20019497v2
Zhanwei Du et al., Serial Interval of COVID-19 among Publicly Reported Confirmed Cases,https://wwwnc.cdc.gov/eid/article/26/6/20-0357_article
Sheikh Taslim Ali et al. , Serial interval of SARS-CoV-2 was shortened over time by nonpharmaceutical interventions, https://science.sciencemag.org/content/early/2020/07/20/science.abc9004

DISCLAIMER: Software and data is for education and not for medical or commercial use. They are provided as-is, and any express or implied warranties, including but not limited to implied warranties of merchantability and fitness for a particular purpose, are disclaimed. Use it at your own discretion.

Cite As

milan batista (2020). estimate_R (https://www.mathworks.com/matlabcentral/fileexchange/78760-estimate_r), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

Updates

1.1.2

Correct runCountry.m

1.1.1

Update descripion

1.1.0

Add various plot and config options. Add incidence rate to estimate_R class. Add epiData class.

1.0.11

Update description

1.0.10

Change title

1.0.9

add getRes.m with R-calculated results for comparison

1.0.7

add function trimData

1.0.6

Update description

1.0.4

Update description

1.0.3

Add function importDataWM

1.0.2

Update description

1.0.1

update description

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux

epiTools_v02

epiTools_v02/data

epiTools_v02/examples

epiTools_v02/mEpiTools/mEpiData

epiTools_v02/mEpiTools/mEpiData/@epiData

epiTools_v02/mEpiTools/mEpiEstim

epiTools_v02/mEpiTools/mEpiEstim/@estimate_R

epiTools_v02/verification