Nowcast correction function using the negative binomial distribution.
Source:R/nowcast_expand.R
nowcast_correction_fn_negbin_mm.Rd
For more details see the help vignette:
vignette("nowcast", package="attrib")
Arguments
- data
Data generated with nowcast_aggregate containing the part of the dataset that the model should train on.
- n_week_adjusting
Number of weeks to correct
- offset
Boolian value which is set to true if offset(log(pop)) is a part of the formula
- date_0
Date of aggregation.
Value
nowcast_correction_object including corrected data for all weeks in n_wwk_adjust and the model fits for all weeks
Examples
if (FALSE) {
data<- data.table::as.data.table(data_fake_nowcasting_county_aggregated)
n_week_adjusting <- 5
n_week_start <- 52
#first date not in the dataset, assume the dataset is ordered.
date_0 <- data[nrow(data),]$cut_doe + 1
data <- data[cut_doe >= (date_0 - n_week_start*7 + 1), ]
nowcast_correction_object <- nowcast_correction_fn_negbin_mm(data,
n_week_adjusting, offset = "log(pop)" , date_0)
}