Estimate and Forecast Real-Time Infection Dynamics
Add breakpoints to certain dates in a data set.
Adds a day of the week vector
Add missing values for future dates
Allocate Delays into Required Stan Format
Allocate Empty Parameters to a List
Apply default CDF cutoff to a <dist_spec> if it is unconstrained
Convert zero case counts to NA (missing) if the 7-day average is abo...
Back Calculation Options
Fit a Subsampled Bootstrap to Integer Values and Summarise Distributio...
Define bounds of a <dist_spec>
Combines multiple delay distributions for further processing
Calculate Credible Interval
Calculate Credible Intervals
Calculate All Summary Measures
Calculate Summary Statistics
Extract elements from epinow objects with deprecated warnings
Extract elements from estimate_infections objects with deprecated warn...
Extract elements from estimate_secondary objects with deprecated warni...
Validate probability distribution for using as generation time
Validate data input
Check that PMF tail is not sparse
Validate probability distribution for passing to stan
Check and warn if truncation distribution is longer than observed time
Clean Nowcasts for a Supplied Date
Clean Regions
Collapse nonparametric distributions in a <dist_spec>
Combine time-varying and static parameters
Construct Output
Convert mean and sd to log mean for a log normal distribution
Convert mean and sd to log standard deviation for a log normal distrib...
Internal function for converting parameters to natural parameters.
Convolve and scale a time series
Copy Results From Dated Folder to Latest
Create Back Calculation Data
Create initial conditions for delays
Construct the Required Future Rt assumption
Create Gaussian Process Data
Create summary output from infection estimation objects
Create Initial Conditions Generating Function
Create Observation Model Settings
Create Time-varying Reproduction Number Data
Create sampling log message
Create Delay Shifted Cases
Create a List of Stan Arguments
Create Stan Data Required for estimate_infections
Create delay variables for stan
Create parameters for stan
Temporary function to support the transition to full support of missin...
Delay Distribution Options
Discretised probability mass function
Discretise a <dist_spec>
Fit an Integer Adjusted Exponential, Gamma or Lognormal distributions
Get parametric distribution types
Probability distributions
Real-time Rt Estimation, Forecasting and Reporting
Load and compile an EpiNow2 cmdstanr model
Load an EpiNow2 rstan model.
Return a stan model object for the appropriate backend
EpiNow2: Estimate and Forecast Real-Time Infection Dynamics
Compares two delay distributions
Estimate a Delay Distribution
Estimate Infections, the Time-Varying Reproduction Number and the Rate...
Estimate a Secondary Observation from a Primary Observation
Estimate Truncation of Observed Data
Estimate Cases by Report Date
Expose internal package stan functions in R
Extract Credible Intervals Present
Extract delay distributions from a fitted model
Extract samples from all delay parameters
Generate initial conditions from a Stan fit
Extract samples for a latent state from a Stan model
Extract parameter samples from a Stan model
Extract samples from all parameters
Extract parameter names
Extract all samples from a stan fit
Extract scalar parameters from a fitted model
Extract a single element of a composite <dist_spec>
Extract a parameter summary from a Stan object
Fill missing data in a data set to prepare it for use within the packa...
Filter leading zeros from a data set.
Filter Options for a Target Region
Fit a Stan Model using an approximate method
Fit a Stan Model using the NUTs sampler
Fit a model using the chosen backend.
Fix the parameters of a <dist_spec>
Forecast infections from a given fit and trajectory of the time-varyin...
Forecast options
Forecast Secondary Observations Given a Fit from estimate_secondary
Format Posterior Samples
Format quantile predictions
Format sample predictions
Format raw Stan samples with dates and metadata
Format Simulation Output from Stan
Generation Time Distribution Options
Get the distribution of a <dist_spec>
Extracts an element of a <dist_spec>
Get parameters from distributions or fitted models
Get the probability mass function of a nonparametric distribution
Get predictions from a fitted model
Get a Single Raw Result
Get Combined Regional Results
Get Regions with Most Reported Cases
Get Folders with Results
Get posterior samples from a fitted model
Estimate seeding time from delays and generation time
Approximate Gaussian Process Settings
Convert Growth Rates to Reproduction numbers.
Check if a <dist_spec> is constrained, i.e. has a finite maximum or no...
Choose a parallel or sequential apply function
Get the lower bounds of the parameters of a distribution
Format Credible Intervals
Internal function to create a parameter list
Categorise the Probability of Change for Rt
Match User Supplied Arguments with Supported Options
Returns the maximum of one or more delay distribution
Returns the mean of one or more delay distribution
Merge truncation predictions with observations for display
Get the names of the natural parameters of a distribution
Calculate the number of distributions in a <dist_spec>
Internal function for generating a dist_spec given parameters and a ...
Observation Model Options
Forecast optiong
Pads reported cases with daily initial zeros
Plot EpiNow2 Credible Intervals
Plot Estimates
Plot a Summary of the Latest Results
Plot PMF and CDF for a dist_spec object
Plot method for estimate_infections
Plot method for estimate_secondary
Plot method for estimate_truncation
Plot method for forecast_infections
Plot method for forecast_secondary objects
Creates a delay distribution as the sum of two other delay distributio...
Create a Normal distribution from posterior samples
Prepare truncation observations for Stan
Prints the parameters of one or more delay distributions
Print information about an object that has resulted from a model fit.
Process regional estimate
Process all Region Estimates
Convert Reproduction Numbers to Growth Rates
Reconstruct a dist_spec from stored stan data and posterior
Reconstruct a nonparametric delay distribution
Reconstruct a parametric delay distribution
Real-time Rt Estimation, Forecasting and Reporting by Region
Summarise Regional Runtimes
Regional Summary Output
Report plots
Provide Summary Statistics for Estimated Infections and Rt
Time-Varying Reproduction Number Options
Run epinow with Regional Processing Code
Save Estimated Infections
Save Observed Data
Returns the standard deviation of one or more delay distribution
Secondary Reports Options
Internal helper function to select plots from those created by `report...
Set to Single Threading
Setup Default Logging
Convert to Data Table
Set up Future Backend
Setup Logging
Setup Target Folder for Saving
Simulate infections using the renewal equation
Simulate secondary observations from primary observations
Numerically stable convolution function for two pmf vectors
Stan Laplace algorithm Options
Stan Options
Stan pathfinder algorithm Options
Stan Sampling Options
Stan Variational Bayes Options
Extract elements from epinow objects with bracket notation
Extract elements from estimate_infections objects with bracket notatio...
Extract elements from estimate_secondary objects with bracket notation
Summarise rt and cases
Summarise Real-time Results
Summary output from epinow
Summary output from estimate_infections
Summarise results from estimate_secondary
Summarise results from estimate_truncation
Summary output from forecast_infections
Truncation Distribution Options
Updates Forecast Horizon Based on Input Data and Target
Update estimate_secondary default priors
Estimates the time-varying reproduction number, rate of spread, and doubling time using a renewal equation approach combined with Bayesian inference via Stan. Supports Gaussian process and random walk priors for modelling changes in transmission over time. Accounts for delays between infection and observation (incubation period, reporting delays), right-truncation in recent data, day-of-week effects, and observation overdispersion. Can estimate relationships between primary and secondary outcomes (e.g., cases to hospitalisations or deaths) and forecast both. Runs across multiple regions in parallel. Based on Abbott et al. (2020) <doi:10.12688/wellcomeopenres.16006.1> and Gostic et al. (2020) <doi:10.1101/2020.06.18.20134858>.
Useful links