From 9f5bef8fc1039e35093cbb15a4ae74a0a6170d42 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Tue, 12 Nov 2024 11:05:18 +0000 Subject: [PATCH] fix bug in estimating initial growth --- R/create.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]