This function fits a specified distribution to the data in a given data frame and adds the fitted distribution as a new column.

add_fitted_dist(cost_df, dist)

Arguments

cost_df

A data frame containing the data to which the distribution will be fitted. The data frame should have columns named "mean", "lb_95", and "ub_95".

dist

A character string specifying the distribution to fit. The distribution should be one of the distributions supported by the q function in R (e.g., "norm" for normal distribution, "tri" for triangular distribution).

Value

A data frame with an additional column named fitt_dist containing the fitted distribution for each row.

Examples

if (FALSE) { # \dontrun{
cost_df <- data.frame(mean = c(10, 20), lb_95 = c(5, 15), ub_95 = c(15, 25))
add_fitted_dist(cost_df, "norm")
} # }