Fit GPD Distribution to Threshold Exceedances
fit_gpd_threshold.RdFits a Generalized Pareto Distribution to values exceeding a threshold. This is the Peaks Over Threshold (POT) approach.
Usage
fit_gpd_threshold(
data,
variable = "wave_height",
threshold = NULL,
decluster = TRUE,
decluster_hours = 48
)Arguments
- data
Data frame with the variable to analyze
- variable
Name of the variable column (default: "wave_height")
- threshold
Threshold value (default: NULL, uses 95th percentile)
- decluster
Logical, whether to decluster exceedances (default: TRUE)
- decluster_hours
Minimum hours between independent exceedances (default: 48)
Value
List with:
fit: extRemes fevd object
exceedances: data frame of exceedances
threshold: threshold used
parameters: GPD parameters (scale, shape)
Examples
if (FALSE) { # \dontrun{
con <- connect_duckdb()
data <- query_buoy_data(con, variables = c("time", "wave_height"))
gpd_result <- fit_gpd_threshold(data, threshold = 6)
DBI::dbDisconnect(con)
} # }