diff --git a/NEWS.md b/NEWS.md index 6549cfb0c..a93ec1b4d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # EpiNow2 (development version) +## Model changes + +- A bug was fixed where the initial growth was never estimated (i.e. the prior mean was always zero). By @sbfnk in #853 and reviewed by @seabbs. + # EpiNow2 1.6.1 ## Model changes diff --git a/R/create.R b/R/create.R index 6e0cf94e1..1309fd508 100644 --- a/R/create.R +++ b/R/create.R @@ -561,7 +561,7 @@ create_stan_data <- function(data, seeding_time, if (stan_data$seeding_time > 1 && nrow(first_week) > 1) { safe_lm <- purrr::safely(stats::lm) stan_data$prior_growth <- safe_lm(log(confirm) ~ t, - stan_data = first_week + data = first_week )[[1]] stan_data$prior_growth <- ifelse(is.null(stan_data$prior_growth), 0, stan_data$prior_growth$coefficients[2]