Skip to content

Commit

Permalink
removed old convert_params function, WIP #164
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Aug 24, 2023
1 parent c5ed3f5 commit 0151bc3
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions R/calc_dist_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,42 +116,3 @@ calc_dist_params <- function(prob_dist,
# return params
prob_dist_params
}

#' Converts summary statistics to parameters of a probability distribution
#'
#' @description The summary_stats object needs to have a class attribute with
#' the name of the probability distribution in order for the correct conversion
#' function to be dispatched.
#'
#' @inheritParams new_epidist
#' @inheritParams epidist
#'
#' @return Named vector
#' @keywords internal
convert_params <- function(summary_stats,
prob_dist) {
params <- switch(prob_dist,
"gamma" = unlist(
gamma_meansd2shapescale(
mean = summary_stats$centre_spread$mean,
sd = summary_stats$centre_spread$sd
)
),
"lnorm" = unlist(
lnorm_meansd2meanlogsdlog(
mean = summary_stats$centre_spread$mean,
sd = summary_stats$centre_spread$sd
)
),
"weibull" = unlist(
weibull_meansd2shapescale(
mean = summary_stats$centre_spread$mean,
sd = summary_stats$centre_spread$sd
)
),
stop("No conversion functions for ", prob_dist, call. = FALSE)
)

# return params
params
}

0 comments on commit 0151bc3

Please sign in to comment.