Skip to content

Commit

Permalink
Use mean method for epidist, fixes #81
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikunterwegs committed Sep 15, 2023
1 parent 703b4ce commit 557dfe9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions R/estimate_time_varying.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,8 @@ estimate_time_varying <- function(data,
#' @keywords internal
get_default_burn_in <- function(epidist) {
default_value <- 7L
if (!missing(epidist) && epiparameter::is_parameterised(epidist)) {
# hardcoded access to mean as epiparameter::get_parameter()
# returns distr-specific params (e.g. meanlog, shape)
x <- do.call(
epiparameter::convert_params_to_summary_stats,
append(
list(stats::family(epidist)),
epiparameter::get_parameters(epidist)
)
)[["mean"]]
x <- as.integer(round(x))
if (!missing(epidist) && !is.na(mean(epidist))) {
x <- as.integer(round(mean(epidist)))
} else {
x <- default_value
}
Expand Down

0 comments on commit 557dfe9

Please sign in to comment.