Learn R Programming

incidental

Overview

incidental contains an empirical Bayes incidence curve fitting from a set of reported cases and a delay distribution:

  • fit_incidence() fits incidence to a set of reported cases and a delay distribution.
  • incidence_to_df() utility function to return the output of fit_incidence() as a data frame.
  • plot() utility function to plot the output of fit_incidence()

You can learn more about incidental in the vignettes.

Installation

install.packages("incidental")

Copy Link

Version

Install

install.packages('incidental')

Monthly Downloads

173

Version

0.1

License

MIT + file LICENSE

Maintainer

Lauren Hannah

Last Published

September 16th, 2020

Functions in incidental (0.1)

covid_delay_dist

Delay distribution from COVID-19 pandemic.
data_check

Input data check
compute_log_incidence

Compute log likelihood of incidence model
data_processing

Data processing wrapper
diff_trans

Transpose of the 1st difference operator
front_zero_pad

Pad reported data with zeros in front
covid_new_york_city

New York City data from the COVID-19 pandemic.
poisson_objective

Poisson objective function
plot.incidence_spline_model

Plot model from fit_incidence
incidental

incidental: A package for computing incidence curves from delayed case records.
init_params

Initialize spline parameters (beta)
make_likelihood_matrix

Make delay likelihood matrix
make_ar_extrap_samps

Make AR samples for extrapolation past end point
fit_incidence

Fit incidence curve to reported data
regfun_grad

Beta regularization function gradient
regfun

Beta regularization function
marg_loglike_poisson_fisher

Marginal log likelihood Fisher information matrix
marg_loglike_poisson_grad

Marginal log likelihood gradient
make_spline_basis

Create spline basis matrix
marg_loglike_poisson

Marginal log likelihood This function computes the marginal probability of Pr(reported | beta). Note that lnPmat must be zero padded enough (or censored) to match the length of reported cases vector.
spanish_flu

Daily flu mortality from 1918 flu pandemic.
scan_spline_dof

Scan spline degrees of freedom
poisson_objective_grad

Poisson objective function gradient
poisson_objective_post_cov_approx

Compute Fisher information matrix for Poisson objective
scan_spline_lam

Scan spline regularization parameter
regfun_hess

Beta regularization function Hessian
train_val_split

Split reported case data
train_and_validate

Train and validate model on reported data
spanish_flu_delay_dist

Delay distribution from 1918 flu pandemic.
sample_laplace_log_incidence_poisson

Generate Laplace samples of incidence
incidence_to_df

Export incidence model to data frame
compute_expected_cases

Compute expected cases