simcrv: Simulate a hospitalization curve

View source: R/simcrv_funs.R

simcrvR Documentation

Simulate a hospitalization curve

Description

Simulate a hospitalization curve

Usage

simcrv(
  print.plot = FALSE,
  print.samples = FALSE,
  print.eq = FALSE,
  verbose = FALSE,
  peakdist = dist_tf_peaks,
  hstdat = ed,
  predfits = tf_pred,
  fitseas = tf_seas,
  nu.min = 0.75,
  nu.max = 1.25,
  cv_list = cv_tf,
  lambda_type = c("lambda.min", "lambda.1se")
)

Arguments

print.plot

Logical. Print a plot of the simulated curve. Default: FALSE

print.samples

Logical. Print stochastically sampled parameters as the function runs. Default: FALSE

print.eq

Logical. Print values calculated using the modified formula from Brooks et al (see Details). Default: FALSE

verbose

Logical. Equivalent to setting both print.samples and print.eq to TRUE. Default: FALSE.

peakdist

Observed peak hospitalizations (height and week) from trend filter fits to FluSurv-NET (EIP) data.

hstdat

Observed hospitalization curves from FluSurv-NET.

predfits

Trend filter predictions based on fits to observed hospitalization curves.

fitseas

Trend filter fit objects for each observed hospitalization curve.

nu.min

Numeric. Minimum for random uniform draw governing simulated curve shifting.

nu.max

Numeric. Maximum for random uniform draw governing simulated curve shifting.

cv_list

List. containing cross-validation output for each season's trendfilter fit.

lambda_type

Character. One of "lambda.min" or "lambda.1se", each corresponding to different criteria used to select the lambda penalty for each trendfilter fit. Per the genlasso package documentation, "lambda.min" is the lambda that minimizes the cross-validated error (average error across folds), while "lambda.1se" selects the largest lambda value that produces a cross-validated error within one standard deviation of the minimum cross-validated error.

Details

Methods adapted from:

Brooks LC, Farrow DC, Hyun S, Tibshirani RJ, Rosenfeld R. Flexible Modeling of Epidemics with an Empirical Bayes Framework. PLoS Comput Biol. 2015 Aug;11(8):e1004382. Available from: http://dx.doi.org/10.1371/journal.pcbi.1004382

Value

Simulated curve depicting weekly hospitalization rates during a hypothetical flu season. Returns a list containing two nested lists, one storing sampled values from random draws, and one storing the results of feeding these values into the curve generating function.


jrgant/FluHospPrediction documentation built on May 7, 2023, 10:40 a.m.