Creates a validated configuration object for running state-level NHSN nowcasts.
Usage
nowcast_config(
max_delay = 7L,
scale_factor = 3,
prop_delay = 0.5,
uncertainty_model = c("negative_binomial", "normal", "skellam"),
draws = 1000L,
robust_sample = FALSE,
nonneg_pred = FALSE,
location = NULL,
output_dir = NULL
)Arguments
- max_delay
Integer. Maximum delay (in weeks) to consider for the reporting triangle. Default is 7.
- scale_factor
Numeric. Multiplicative factor on max_delay for training volume in baselinenowcast. Default is 3.
- prop_delay
Numeric between 0 and 1. Proportion of training data used for delay estimation. Default is 0.5.
- uncertainty_model
Character. One of
"negative_binomial"(default),"normal", or"skellam". Specifies the uncertainty model for probabilistic nowcasts.- draws
Integer. Number of posterior draws for probabilistic nowcasts. Default is 1000.
- robust_sample
Logical. If
TRUE, make the uncertainty sampler robust so it can always draw. For the"skellam"model this increases the variance to the minimum value that yields valid (positive) Poisson rates for the given nowcast mean, instead of erroring whenvariance <= |pred|(seesample_skellam()). No-op for"normal"and"negative_binomial", which cannot fail this way. Default isFALSE.- nonneg_pred
Logical. If
TRUE, clamp negative predicted counts in the final nowcast to0. This guards against draws where the summed revisions push the combined count below zero, at the cost of distorting the probabilistic model near zero. Default isFALSE.- location
Character. A single location code (e.g.,
"ca"). Default isNULL, meaning no specific location is set.- output_dir
Character. Directory path for partitioned parquet output. If
NULL, results are returned but not written to disk. Default isNULL.