Skip to content

Commit

Permalink
fix bug in estimating initial growth
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Nov 12, 2024
1 parent 8f9016d commit 9f5bef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9f5bef8

Please sign in to comment.