Learn R Programming

DUToolkit (version 1.0.2)

calculate_threshold_probs: Calculate threshold exceedance probabilities

Description

For each policy alternative, this function calculates the probability that the peak (or minimum) value exceeds (or is below) a specified threshold(s) using a Riemann sum approach.

Usage

calculate_threshold_probs(max_min_values_list, Dp, Dt_max = TRUE)

Value

A list of vectors of threshold values and corresponding probabilities.

Arguments

max_min_values_list

A list generated by get_max_min_values()

Dp

A vector of threshold values to calculate the probabilities for.

Dt_max

A logical value indicating whether the decision threshold is a maximum (TRUE) or a minimum (FALSE). The default is TRUE.

Examples

Run this code
tmin <- "2021-01-01"
tmax <- "2021-04-10"
D <- 750
Dp <- c(750, 1000, 2000)

peak_values_list <- get_max_min_values(
  psa_data,
  tmin = tmin,
  tmax = tmax,
  Dt_max = TRUE
)

calculate_threshold_probs(
  peak_values_list,
  Dp = Dp,
  Dt_max = TRUE
)

Run the code above in your browser using DataLab