geoevgam: Fit Geometric Extreme Value Generalized Additive Models

View source: R/geoevgam.R

geoevgamR Documentation

Fit Geometric Extreme Value Generalized Additive Models

Description

Fits a two-stage model consisting of a threshold model (using Asymmetric Laplace Distribution) and an exceedance model (using a Gamma-type distribution).

Usage

geoevgam(
  formula,
  data,
  args = list(),
  trace = 0,
  knots = list(threshold = NULL, excess = NULL),
  norm = 2
)

Arguments

formula

A list of two formulas named threshold and excess. If missing, defaults to smooth angular terms.

data

A data frame containing the variables in the model, including radius and angle.

args

A list of additional arguments. tau (quantile) defaults to 0.8.

trace

Integer vector of length 1 or 2. Control verbose output for both fitting stages.

knots

A list containing knot specifications for threshold and excess.

norm

The L-p norm used in the geometric calculations. Defaults to 2.

Value

An object of class geoevgam containing the fitted models and the norm used.

References

Murphy-Barltrop, C.J.R., Wadsworth, J.L., Carvalho, M.d., Youngman, B.D. Modelling non-stationary extremal dependence through a geometric approach. Extremes (2026). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10687-026-00543-w")}

Examples


n <- 1e3
gauss_sim_data <- rmvnorm(n, numeric(2), matrix(c(1, .8, .8, 1), 2))
laplace_sim_data <- qlaplace(pnorm(gauss_sim_data))
polar1 <- polarise(t(laplace_sim_data), norm = 2)
data1 <- data.frame(radius = polar1$r, angle = polar1$phi[1, ])
fit1 <- geoevgam(data = data1)


# example using L_1 norm
polar2 <- polarise(t(laplace_sim_data), norm = 1)
data2 <- data.frame(radius = polar2$r, angle = polar2$phi[1, ])
fit2 <- geoevgam(data = data2) 

# example using different threshold and user-specified splines and knots
angles <- seq(0, 2 * pi, by = pi / 4)
angles <- sort(c(angles, outer(c(pi / 4, pi + pi / 4), c(-pi / 16, pi / 16), '+')))
fmla <- knts <- list()
knts$threshold <- knts$excess <- list(angle = angles)
fmla$threshold <- fmla$excess <- radius ~ s(angle, bs = 'cp', k = length(angles) - 1)
fit3 <- geoevgam(data = data1, formula = fmla, knots = knts, args = list(tau = .9))



evgam documentation built on Sept. 3, 2026, 5:09 p.m.