EpiNow21.8.0 package

Estimate and Forecast Real-Time Infection Dynamics

add_breakpoints

Add breakpoints to certain dates in a data set.

add_day_of_week

Adds a day of the week vector

add_horizon

Add missing values for future dates

allocate_delays

Allocate Delays into Required Stan Format

allocate_empty

Allocate Empty Parameters to a List

apply_default_cdf_cutoff

Apply default CDF cutoff to a <dist_spec> if it is unconstrained

apply_zero_threshold

Convert zero case counts to NA (missing) if the 7-day average is abo...

backcalc_opts

Back Calculation Options

bootstrapped_dist_fit

Fit a Subsampled Bootstrap to Integer Values and Summarise Distributio...

bound_dist

Define bounds of a <dist_spec>

c.dist_spec

Combines multiple delay distributions for further processing

calc_CrI

Calculate Credible Interval

calc_CrIs

Calculate Credible Intervals

calc_summary_measures

Calculate All Summary Measures

calc_summary_stats

Calculate Summary Statistics

cash-.epinow

Extract elements from epinow objects with deprecated warnings

cash-.estimate_infections

Extract elements from estimate_infections objects with deprecated warn...

cash-.estimate_secondary

Extract elements from estimate_secondary objects with deprecated warni...

check_generation_time

Validate probability distribution for using as generation time

check_reports_valid

Validate data input

check_sparse_pmf_tail

Check that PMF tail is not sparse

check_stan_delay

Validate probability distribution for passing to stan

check_truncation_length

Check and warn if truncation distribution is longer than observed time

clean_nowcasts

Clean Nowcasts for a Supplied Date

clean_regions

Clean Regions

collapse

Collapse nonparametric distributions in a <dist_spec>

combine_tv_and_static_params

Combine time-varying and static parameters

construct_output

Construct Output

convert_to_logmean

Convert mean and sd to log mean for a log normal distribution

convert_to_logsd

Convert mean and sd to log standard deviation for a log normal distrib...

convert_to_natural

Internal function for converting parameters to natural parameters.

convolve_and_scale

Convolve and scale a time series

copy_results_to_latest

Copy Results From Dated Folder to Latest

create_backcalc_data

Create Back Calculation Data

create_delay_inits

Create initial conditions for delays

create_future_rt

Construct the Required Future Rt assumption

create_gp_data

Create Gaussian Process Data

create_infection_summary

Create summary output from infection estimation objects

create_initial_conditions

Create Initial Conditions Generating Function

create_obs_model

Create Observation Model Settings

create_rt_data

Create Time-varying Reproduction Number Data

create_sampling_log_message

Create sampling log message

create_shifted_cases

Create Delay Shifted Cases

create_stan_args

Create a List of Stan Arguments

create_stan_data

Create Stan Data Required for estimate_infections

create_stan_delays

Create delay variables for stan

create_stan_params

Create parameters for stan

default_fill_missing_obs

Temporary function to support the transition to full support of missin...

delay_opts

Delay Distribution Options

discrete_pmf

Discretised probability mass function

discretise

Discretise a <dist_spec>

dist_fit

Fit an Integer Adjusted Exponential, Gamma or Lognormal distributions

dist_spec_distributions

Get parametric distribution types

Distributions

Probability distributions

epinow

Real-time Rt Estimation, Forecasting and Reporting

epinow2_cmdstan_model

Load and compile an EpiNow2 cmdstanr model

epinow2_rstan_model

Load an EpiNow2 rstan model.

epinow2_stan_model

Return a stan model object for the appropriate backend

EpiNow2-package

EpiNow2: Estimate and Forecast Real-Time Infection Dynamics

equals-.dist_spec

Compares two delay distributions

estimate_delay

Estimate a Delay Distribution

estimate_infections

Estimate Infections, the Time-Varying Reproduction Number and the Rate...

estimate_secondary

Estimate a Secondary Observation from a Primary Observation

estimate_truncation

Estimate Truncation of Observed Data

estimates_by_report_date

Estimate Cases by Report Date

expose_stan_fns

Expose internal package stan functions in R

extract_CrIs

Extract Credible Intervals Present

extract_delay_params

Extract delay distributions from a fitted model

extract_delays

Extract samples from all delay parameters

extract_inits

Generate initial conditions from a Stan fit

extract_latent_state

Extract samples for a latent state from a Stan model

extract_parameter_samples

Extract parameter samples from a Stan model

extract_parameters

Extract samples from all parameters

extract_params

Extract parameter names

extract_samples

Extract all samples from a stan fit

extract_scalar_params

Extract scalar parameters from a fitted model

extract_single_dist

Extract a single element of a composite <dist_spec>

extract_stan_param

Extract a parameter summary from a Stan object

fill_missing

Fill missing data in a data set to prepare it for use within the packa...

filter_leading_zeros

Filter leading zeros from a data set.

filter_opts

Filter Options for a Target Region

fit_model_approximate

Fit a Stan Model using an approximate method

fit_model_with_nuts

Fit a Stan Model using the NUTs sampler

fit_model

Fit a model using the chosen backend.

fix_parameters

Fix the parameters of a <dist_spec>

forecast_infections

Forecast infections from a given fit and trajectory of the time-varyin...

forecast_opts

Forecast options

forecast_secondary

Forecast Secondary Observations Given a Fit from estimate_secondary

format_fit

Format Posterior Samples

format_quantile_predictions

Format quantile predictions

format_sample_predictions

Format sample predictions

format_samples_with_dates

Format raw Stan samples with dates and metadata

format_simulation_output

Format Simulation Output from Stan

generation_time_opts

Generation Time Distribution Options

get_distribution

Get the distribution of a <dist_spec>

get_element

Extracts an element of a <dist_spec>

get_parameters

Get parameters from distributions or fitted models

get_pmf

Get the probability mass function of a nonparametric distribution

get_predictions

Get predictions from a fitted model

get_raw_result

Get a Single Raw Result

get_regional_results

Get Combined Regional Results

get_regions_with_most_reports

Get Regions with Most Reported Cases

get_regions

Get Folders with Results

get_samples

Get posterior samples from a fitted model

get_seeding_time

Estimate seeding time from delays and generation time

gp_opts

Approximate Gaussian Process Settings

growth_to_R

Convert Growth Rates to Reproduction numbers.

is_constrained

Check if a <dist_spec> is constrained, i.e. has a finite maximum or no...

lapply_func

Choose a parallel or sequential apply function

lower_bounds

Get the lower bounds of the parameters of a distribution

make_conf

Format Credible Intervals

make_param

Internal function to create a parameter list

map_prob_change

Categorise the Probability of Change for Rt

match_output_arguments

Match User Supplied Arguments with Supported Options

max.dist_spec

Returns the maximum of one or more delay distribution

mean.dist_spec

Returns the mean of one or more delay distribution

merge_trunc_pred_obs

Merge truncation predictions with observations for display

natural_params

Get the names of the natural parameters of a distribution

ndist

Calculate the number of distributions in a <dist_spec>

new_dist_spec

Internal function for generating a dist_spec given parameters and a ...

obs_opts

Observation Model Options

opts_list

Forecast optiong

pad_reported_cases

Pads reported cases with daily initial zeros

plot_CrIs

Plot EpiNow2 Credible Intervals

plot_estimates

Plot Estimates

plot_summary

Plot a Summary of the Latest Results

plot.dist_spec

Plot PMF and CDF for a dist_spec object

plot.estimate_infections

Plot method for estimate_infections

plot.estimate_secondary

Plot method for estimate_secondary

plot.estimate_truncation

Plot method for estimate_truncation

plot.forecast_infections

Plot method for forecast_infections

plot.forecast_secondary

Plot method for forecast_secondary objects

plus-.dist_spec

Creates a delay distribution as the sum of two other delay distributio...

posterior_to_normal

Create a Normal distribution from posterior samples

prepare_truncation_obs

Prepare truncation observations for Stan

print.dist_spec

Prints the parameters of one or more delay distributions

print.epinowfit

Print information about an object that has resulted from a model fit.

process_region

Process regional estimate

process_regions

Process all Region Estimates

R_to_growth

Convert Reproduction Numbers to Growth Rates

reconstruct_delay

Reconstruct a dist_spec from stored stan data and posterior

reconstruct_nonparametric

Reconstruct a nonparametric delay distribution

reconstruct_parametric

Reconstruct a parametric delay distribution

regional_epinow

Real-time Rt Estimation, Forecasting and Reporting by Region

regional_runtimes

Summarise Regional Runtimes

regional_summary

Regional Summary Output

report_plots

Report plots

report_summary

Provide Summary Statistics for Estimated Infections and Rt

rt_opts

Time-Varying Reproduction Number Options

run_region

Run epinow with Regional Processing Code

save_estimate_infections

Save Estimated Infections

save_input

Save Observed Data

sd

Returns the standard deviation of one or more delay distribution

secondary_opts

Secondary Reports Options

select_plots

Internal helper function to select plots from those created by `report...

set_dt_single_thread

Set to Single Threading

setup_default_logging

Setup Default Logging

setup_dt

Convert to Data Table

setup_future

Set up Future Backend

setup_logging

Setup Logging

setup_target_folder

Setup Target Folder for Saving

simulate_infections

Simulate infections using the renewal equation

simulate_secondary

Simulate secondary observations from primary observations

stable_convolve

Numerically stable convolution function for two pmf vectors

stan_laplace_opts

Stan Laplace algorithm Options

stan_opts

Stan Options

stan_pathfinder_opts

Stan pathfinder algorithm Options

stan_sampling_opts

Stan Sampling Options

stan_vb_opts

Stan Variational Bayes Options

sub-sub-.epinow

Extract elements from epinow objects with bracket notation

sub-sub-.estimate_infections

Extract elements from estimate_infections objects with bracket notatio...

sub-sub-.estimate_secondary

Extract elements from estimate_secondary objects with bracket notation

summarise_key_measures

Summarise rt and cases

summarise_results

Summarise Real-time Results

summary.epinow

Summary output from epinow

summary.estimate_infections

Summary output from estimate_infections

summary.estimate_secondary

Summarise results from estimate_secondary

summary.estimate_truncation

Summarise results from estimate_truncation

summary.forecast_infections

Summary output from forecast_infections

trunc_opts

Truncation Distribution Options

update_horizon

Updates Forecast Horizon Based on Input Data and Target

update_secondary_args

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>.

  • Maintainer: Sebastian Funk
  • License: MIT + file LICENSE
  • Last published: 2026-02-04