Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulnorthrop/threshr
Threshold Selection and Uncertainty for Extreme Value Analysis
https://github.com/paulnorthrop/threshr
extreme-value-statistics extremes generalized inference pareto plot prediction threshold threshold-selection uncertainty
Last synced: 9 days ago
JSON representation
Threshold Selection and Uncertainty for Extreme Value Analysis
- Host: GitHub
- URL: https://github.com/paulnorthrop/threshr
- Owner: paulnorthrop
- Created: 2017-08-02T12:11:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-02T22:39:15.000Z (about 1 year ago)
- Last Synced: 2024-04-26T23:02:06.297Z (8 months ago)
- Topics: extreme-value-statistics, extremes, generalized, inference, pareto, plot, prediction, threshold, threshold-selection, uncertainty
- Language: R
- Homepage: https://paulnorthrop.github.io/threshr/
- Size: 5.26 MB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```# threshr
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/paulnorthrop/threshr?branch=master&svg=true)](https://ci.appveyor.com/project/paulnorthrop/threshr)
[![R-CMD-check](https://github.com/paulnorthrop/threshr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/paulnorthrop/threshr/actions/workflows/R-CMD-check.yaml)
[![Coverage Status](https://codecov.io/github/paulnorthrop/threshr/coverage.svg?branch=master)](https://app.codecov.io/github/paulnorthrop/threshr?branch=master)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/threshr)](https://cran.r-project.org/package=threshr)
[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/threshr?color=brightgreen)](https://cran.r-project.org/package=threshr)
[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/threshr?color=brightgreen)](https://cran.r-project.org/package=threshr)## Threshold Selection and Uncertainty for Extreme Value Analysis
### What does threshr do?
The `threshr` package deals primarily with the selection of thresholds for use in extreme value models. It also performs predictive inferences about future extreme values. These inferences can either be based on a single threshold or on a weighted average of inferences from multiple thresholds. The weighting reflects an estimated measure of the predictive performance of the threshold and can incorporate prior probabilities supplied by a user. At the moment only the simplest case, where the data can be treated as independent identically distributed observations, is considered, as described in [Northrop et al. (2017)](https://doi.org/10.1111/rssc.12159). Future releases will tackle more general situations.
### A simple example
The main function in the threshr package is `ithresh`. It uses Bayesian leave-one-out cross-validation to compare the extreme value predictive ability resulting from the use of each of a user-supplied set of thresholds. The following code produces a threshold diagnostic plot using a dataset `gom` containing 315 storm peak significant waveheights. We set a vector `u_vec` of thresholds; call `ithresh`, supplying the data and thresholds; and use then plot the results. In this minimal example (`ithresh` has further arguments) thresholds are judged in terms of the quality of prediction of whether the validation observation lies above the highest threshold in `u_vec` and, if it does, how much it exceeds this highest threshold.
```{r, eval = FALSE}
library(threshr)
u_vec_gom <- quantile(gom, probs = seq(0, 0.9, by = 0.05))
gom_cv <- ithresh(data = gom, u_vec = u_vec_gom)
plot(gom_cv)
```### Installation
To get the current released version from CRAN:
```{r installation, eval = FALSE}
install.packages("threshr")
```### Vignette
See `vignette("threshr-vignette", package = "threshr")` for an overview of the package.