MyNixOS website logo
Description

Extreme Value Modeling for r-Largest Order Statistics.

Tools for extreme value modeling based on the r-largest order statistics framework. The package provides functions for parameter estimation via maximum likelihood, return level estimation with standard errors, profile likelihood-based confidence intervals, random sample generation, and entropy difference tests for selecting the number of order statistics r. Several r-largest order statistics models are implemented, including the four-parameter kappa (rK4D), generalized logistic (rGLO), generalized Gumbel (rGGD), logistic (rLD), and Gumbel (rGD) distributions. The rK4D methodology is described in Shin et al. (2022) <doi:10.1016/j.wace.2022.100533>, the rGLO model in Shin and Park (2024) <doi:10.1007/s00477-023-02642-7>, and the rGGD model in Shin and Park (2025) <doi:10.1038/s41598-024-83273-y>. The underlying distributions are related to the kappa distribution of Hosking (1994) <doi:10.1017/CBO9780511529443>, the generalized logistic distribution discussed by Ahmad et al. (1988) <doi:10.1016/0022-1694(88)90015-7>, and the generalized Gumbel distribution of Jeong et al. (2014) <doi:10.1007/s00477-014-0865-8>. Penalized likelihood approaches for extreme value estimation follow Martins and Stedinger (2000) <doi:10.1029/1999WR900330> and Coles and Dixon (1999) <doi:10.1023/A:1009905222644>. Selection of r is supported using methods discussed in Bader et al. (2017) <doi:10.1007/s11222-016-9697-3>. The package is intended for hydrological, climatological, and environmental extreme value analysis.

evmr: Extreme Value Modeling for r-Largest Order Statistics

evmr

evmr is an R package for extreme value modeling using the r-largest order statistics framework.

The package provides tools for fitting, analyzing, and comparing extreme value models that use the largest r observations within each block.

The package is designed for applications in

  • hydrology
  • climatology
  • environmental science
  • extreme risk analysis

where multiple extreme events may occur within the same block.


Installation

# install.packages("remotes")
remotes::install_github("yire-shin/evmr")

Workflow

A typical workflow in evmr is

random generation → model fitting → return level estimation → profile likelihood → r selection

For each supported model, the package provides a consistent set of functions:

functiondescription
random generatorsimulate r-largest order statistics
.fit()fit the model by maximum likelihood
.rl()estimate return levels
.prof()obtain profile likelihood confidence intervals
Edtest()perform entropy difference based sequential testing for selecting r

rK4D Model

The rK4D model is based on the four-parameter Kappa distribution.

Random generation

x <- rk4dr(
  n = 50, r = 3,
  loc = 10, scale = 2,
  shape1 = 0.1, shape2 = 0.1
)

head(x$rmat)

Model fitting

fit <- rk4d.fit(x$rmat, num_inits = 5)
fit$mle

Return levels

rk4d.rl(fit)

Profile likelihood confidence intervals

rk4d.prof(fit, m = 100, xlow = 12, xup = 25)

Entropy difference test for selecting r

rk4dEdtest(x$rmat)

Reference

Shin, Y., & Park, J.-S. (2023).
Modeling climate extremes using the four-parameter kappa distribution for r-largest order statistics.
Weather and Climate Extremes.
https://doi.org/10.1016/j.wace.2022.100533

Hosking, J. R. M. (1994).
The four-parameter Kappa distribution. Cambridge University Press.

Martins, E. S., & Stedinger, J. R. (2000).
Generalized maximum-likelihood generalized extreme-value quantile estimators for hydrologic data.
Water Resources Research.
https://doi.org/10.1029/1999WR900330

Coles, S., & Dixon, M. (1999).
Likelihood-based inference for extreme value models.
Extremes.
https://doi.org/10.1023/A:1009905222644


rGLO Model

The rGLO model is based on the generalized logistic distribution.

Random generation

x <- rglor(
  n = 50, r = 3,
  loc = 10, scale = 2,
  shape = 0.1
)

head(x$rmat)

Model fitting

fit <- rglo.fit(x$rmat, num_inits = 5)
fit$mle

Return levels

rglo.rl(fit)

Profile likelihood confidence intervals

rglo.prof(fit, m = 100, xlow = 12, xup = 25)

Entropy difference test for selecting r

rgloEdtest(x$rmat)

Reference

Ahmad et al. (1988).
Log-logistic flood frequency analysis.
Journal of Hydrology.
https://doi.org/10.1016/0022-1694(88)90015-7

Coles, S. (2001).
An Introduction to Statistical Modeling of Extreme Values.
Springer.
https://doi.org/10.1007/978-1-4471-3675-0

Shin, Y., & Park, J.-S. (2024).
Generalized logistic model for r-largest order statistics with hydrological application.
Stochastic Environmental Research and Risk Assessment.
https://doi.org/10.1007/s00477-023-02642-7


rGGD Model

The rGGD model is based on the generalized Gumbel distribution.

Random generation

x <- rggdr(
  n = 50, r = 3,
  loc = 10, scale = 2,
  shape = 0.1
)

head(x$rmat)

Model fitting

fit <- rggd.fit(x$rmat, num_inits = 5)
fit$mle

Return levels

rggd.rl(fit)

Profile likelihood confidence intervals

rggd.prof(fit, m = 100, xlow = 12, xup = 25)

Entropy difference test

rggdEdtest(x$rmat)

Reference

Coles, S. (2001).
An Introduction to Statistical Modeling of Extreme Values.
Springer.
https://doi.org/10.1007/978-1-4471-3675-0

Jeong et al. (2014).
A three-parameter kappa distribution with hydrologic application: A generalized Gumbel distribution.
https://doi.org/10.1007/s00477-014-0865-8

Shin, Y., & Park, J.-S. (2025).
Generalized Gumbel model for r-largest order statistics with application to peak streamflow.
Scientific Reports.
https://doi.org/10.1038/s41598-024-83273-y


rGD Model

The rGD model is based on the Gumbel distribution.

Random generation

x <- rgdr(
  n = 50, r = 3,
  loc = 10, scale = 2
)

head(x$rmat)

Model fitting

fit <- rgd.fit(x$rmat, num_inits = 5)
fit$mle

Return levels

rgd.rl(fit)

Profile likelihood confidence intervals

rgd.prof(fit, m = 100, xlow = 12, xup = 25)

Entropy difference test for selecting r

rgdEdtest(x$rmat)

Reference

Coles, S., & Dixon, M. (1999).
Likelihood-based inference for extreme value models.
Extremes.
https://doi.org/10.1023/A:1009905222644

Jeong et al. (2014).
A three-parameter kappa distribution with hydrologic application: A generalized Gumbel distribution.
https://doi.org/10.1007/s00477-014-0865-8

Shin, Y., & Park, J.-S. (2025).
Generalized Gumbel model for r-largest order statistics with application to peak streamflow.
Scientific Reports.
https://doi.org/10.1038/s41598-024-83273-y


rLD Model

The rLD model is based on the logistic distribution.

Random generation

x <- rldr(
  n = 50, r = 3,
  loc = 10, scale = 2
)

head(x$rmat)

Model fitting

fit <- rld.fit(x$rmat, num_inits = 5)
fit$mle

Return levels

rld.rl(fit)

Profile likelihood confidence intervals

rld.prof(fit, m = 100, xlow = 12, xup = 25)

Entropy difference test for selecting r

rldEdtest(x$rmat)

Reference

Ahmad et al. (1988).
Log-logistic flood frequency analysis.
Journal of Hydrology.
https://doi.org/10.1016/0022-1694(88)90015-7

Coles, S. (2001).
An Introduction to Statistical Modeling of Extreme Values.
Springer.
https://doi.org/10.1007/978-1-4471-3675-0

Shin, Y., & Park, J.-S. (2024).
Generalized logistic model for r-largest order statistics with hydrological application.
Stochastic Environmental Research and Risk Assessment.
https://doi.org/10.1007/s00477-023-02642-7


Unified Model Comparison Using Real Data

The package also provides a unified wrapper function, evmr(), for fitting multiple models simultaneously.

The following example uses the built-in bangkok dataset.

library(evmr)

data(bangkok)

evmr(
  bangkok,
  models = c("rk4d", "rglo", "rggd", "rgd", "rld"),
  num_inits = 5
)

This returns a combined summary table containing

  • model name
  • parameter estimates
  • likelihood values
  • standard errors
  • return level estimates

References

Ahmad et al. (1988).
Log-logistic flood frequency analysis.
Journal of Hydrology.
https://doi.org/10.1016/0022-1694(88)90015-7

Bader, B., Yan, J., & Zhang, X. (2017).
Automated selection of r for the r-largest order statistics approach.
Statistics and Computing.
https://doi.org/10.1007/s11222-016-9697-3

Coles, S. (2001).
An Introduction to Statistical Modeling of Extreme Values.
Springer.
https://doi.org/10.1007/978-1-4471-3675-0

Coles, S., & Dixon, M. (1999).
Likelihood-based inference for extreme value models.
Extremes.
https://doi.org/10.1023/A:1009905222644

Hosking, J. R. M. (1994).
The four-parameter Kappa distribution. Cambridge University Press.

Martins, E. S., & Stedinger, J. R. (2000).
Generalized maximum-likelihood generalized extreme-value quantile estimators for hydrologic data.
Water Resources Research.
https://doi.org/10.1029/1999WR900330

Jeong et al. (2014).
A three-parameter kappa distribution with hydrologic application: A generalized Gumbel distribution.
https://doi.org/10.1007/s00477-014-0865-8

Shin, Y., & Park, J.-S. (2023).
Modeling climate extremes using the four-parameter kappa distribution for r-largest order statistics.
Weather and Climate Extremes.
https://doi.org/10.1016/j.wace.2022.100533

Shin, Y., & Park, J.-S. (2024).
Generalized logistic model for r-largest order statistics with hydrological application.
Stochastic Environmental Research and Risk Assessment.
https://doi.org/10.1007/s00477-023-02642-7

Shin, Y., & Park, J.-S. (2025).
Generalized Gumbel model for r-largest order statistics with application to peak streamflow.
Scientific Reports.
https://doi.org/10.1038/s41598-024-83273-y.

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows