plot_density | R Documentation |
For each policy alternative, this function generates probability density plots of the highest (or lowest if the threshold is a minimum) projected outcome across simulation runs. The decision threshold is shown directly on the plot as a vertical line. The area under the probability density curve where the threshold value is exceeded is shaded to visually display the downside risk of the policy alternative.
plot_density(max_min_values_list, D, Dt_max = TRUE, risk_measures)
max_min_values_list |
A list generated by |
D |
A single threshold value |
Dt_max |
A logical value indicating whether the decision threshold
is a maximum ( |
risk_measures |
A list of risk scores generated by |
A list of ggplots, one for each policy alternative.
tmin <- "2021-01-01"
tmax <- "2021-04-10"
Dt <- rep(750, nrow(psa_data$Baseline))
D <- 750
risk_measures <- calculate_risk(
psa_data,
tmin = tmin,
tmax = tmax,
Dt = Dt,
Dt_max = TRUE
)
peak_values_list <- get_max_min_values(
psa_data,
tmin = tmin,
tmax = tmax,
Dt_max = TRUE
)
density_plots <- plot_density(
peak_values_list,
D = D,
Dt_max = TRUE,
risk_measures
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.