Learn R Programming

EpiNow2 (version 1.1.0)

bootstrapped_dist_fit: Fit a Subsampled Bootstrap to Integer Values and Summarise Distribution Parameters

Description

Fit a Subsampled Bootstrap to Integer Values and Summarise Distribution Parameters

Usage

bootstrapped_dist_fit(
  values,
  dist = "lognormal",
  samples = 2000,
  bootstraps = 10,
  bootstrap_samples = 250,
  verbose = FALSE
)

Arguments

values

Numeric vector of integer values.

dist

Character string, which distribution to fit. Defaults to lognormal ("lognormal") but gamma ("gamma") is also supported.

samples

Numeric, number of samples to take overall from the bootstrapped posteriors.

bootstraps

Numeric, defaults to 1. The number of bootstrap samples (with replacement) of the delay distribution to take.

bootstrap_samples

Numeric, defaults to 100. The number of samples to take in each bootstrap. When the sample size of the supplied delay distribution is less than 100 this is used instead.

verbose

Logical, defaults to FALSE. Should progress messages be printed

Value

A list summarising the bootstrapped distribution

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# lognormal
delays <- rlnorm(500, log(5), 1)

out <- bootstrapped_dist_fit(delays, samples = 1000, bootstraps = 10, 
                             dist = "lognormal")

## Inspect
out

# }

Run the code above in your browser using DataLab