Skip to content

EpiStrainDynamics 0.2.0

Latest

Choose a tag to compare

@smwindecker smwindecker released this 03 Nov 07:23
f4477f7

Clearer names for the inputs and outputs, a breakdown of convergence diagnostics by pathogen and time, and a fix for compiling the Stan models with newer stanc3. Code written for 0.1.0 may need updating: see Breaking changes.

Breaking changes

  • subtyped()'s unsubtyped_timeseries argument is now
    parent_timeseries, since it takes the total count for the parent
    pathogen, covering both subtyped and unsubtyped cases; the previous name
    suggested it took only the unsubtyped cases (#80). Any code calling
    subtyped() with unsubtyped_timeseries will need to use
    parent_timeseries.
  • The Stan model parameters have descriptive names (#82). a is now
    log_incidence in random walk models and b_spline_coef in p-spline
    models, where the trajectory a_new is now log_incidence; c and
    c_new are now noisy_incidence. Previously a meant the trajectory in
    one method and the spline coefficients in the other; now
    log_incidence is the latent log-incidence trend in every model. Code
    that reads the stanfit object in fit$fit directly (e.g. with
    bayesplot or rstan::summary()) will need to use the new names;
    incidence(), growth_rate(), Rt() and proportion() are unaffected.
  • The prop column in $measure is now prob_above, since it is the
    posterior probability that the quantity is above a threshold, not a
    proportion (#79). growth_rate() and Rt() return it for thresholds of 0
    and 1, giving the probability that the epidemic is growing; their
    documentation now says so. incidence() and proportion() no longer
    return it, as the probability that incidence or a proportion is above 0
    is always 1.

New features

  • diagnose_model() now returns a parameters table giving each
    parameter's R-hat and effective sample size, labelled with the pathogen
    and time it refers to, and a plot() method shows R-hat or effective
    sample size of the log-incidence trajectory over time by pathogen (#85).

Bug fixes

  • Fixed the Stan models failing to compile with newer versions of stanc3,
    which reject the old array syntax (e.g. real[] t, int Y[n]). This
    broke the R-universe build (@jeroen, #77, #78).

Minor improvements

  • subtyped() now errors if parent_timeseries is smaller than the sum of
    subtyped_timeseries at any time point, since the subtyped cases are a
    subset of the parent total (#80). Previously such data was accepted and
    would silently underestimate the parent pathogen.

Documentation

  • Further corrected the influenza dataset documentation: inf_A is all
    influenza A positives, including those subtyped; counts are weekly
    rather than daily; the date range matches the data included (January
    2012 to February 2020); the inf_* columns are described as positive
    laboratory specimens; and other is described with how it is
    calculated (#80).
  • The subtyped() documentation, vignette and README now describe
    parent_timeseries as the total for the parent pathogen (#80).