calculate_threshold_probs: Calculate threshold exceedance probabilities

View source: R/calculate_threshold_probs.R

calculate_threshold_probsR Documentation

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)

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.

Value

A list of vectors of threshold values and corresponding probabilities.

Examples

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
)

DUToolkit documentation built on Sept. 14, 2025, 5:09 p.m.