Skip to contents

The package ships the scripts that reproduce every table, figure and number of the accompanying article. They download the public data, so they are not run when the vignette is built.

Sys.setenv(BP_DATA = "data", BP_OUT = "article-output", BP_CORES = "4",
           OPENBLAS_NUM_THREADS = "1")
source(system.file("article", "run_all.R", package = "beatpool"))

What each step does

  1. 01_data.R calls download_physionet() for the MIT-BIH Arrhythmia Database, the MIT-BIH Supraventricular Arrhythmia Database and the St Petersburg INCART database, and read_database() to segment the first signal (lead II in INCART) into windows of 61, 31 and 43 samples around the annotated R peaks. It also downloads the 49 industry portfolios of the French data library and standardizes them within each year.
  2. 02_heldout.R leaves out one record at a time, or one patient in INCART, and estimates every operator from the others: pool_spectral(), pool_covariance(), pool_bases(), hierarchical_pool(), energy_moment() with pool_shared(), and dct_basis(). It records the mean per-beat error, the ratio of traces, the rate of rate_distortion() and the separation of normal and ventricular beats.
  3. 03_summary.R computes paired bootstrap intervals over records or patients and writes the tables and values.tex.
  4. 04_figures.R draws the figures.

The scripts live in system.file("article", package = "beatpool").