Skip to contents

Analyzes how often extreme events co-occur at multiple stations.

Usage

analyze_joint_extremes(
  data,
  variable = "wave_height",
  threshold_quantile = 0.95
)

Arguments

data

Data frame with columns: time, station_id, and the variable

variable

Variable to analyze (default: "wave_height")

threshold_quantile

Quantile threshold for "extreme" (default: 0.95)

Value

List with:

  • joint_extreme_counts: matrix of joint extreme event counts

  • conditional_probs: P(station j extreme | station i extreme)

  • extreme_events: data frame of all extreme events

Examples

if (FALSE) { # \dontrun{
data <- data.frame(
  time = rep(seq(as.POSIXct("2024-01-01"), by = "hour", length.out = 100), 2),
  station_id = rep(c("M2", "M3"), each = 100),
  wave_height = c(rnorm(100, 3, 1), rnorm(100, 2.5, 0.8))
)
analyze_joint_extremes(data)
} # }