predict.geoevgam: Predictions from a geoevgam fit

View source: R/geoevgam.R

predict.geoevgamR Documentation

Predictions from a geoevgam fit

Description

Generates predictions from the threshold and/or exceedance components of a fitted geoevgam model. This is a convenience wrapper around the corresponding predict() methods for the underlying fitted evgam objects.

Usage

## S3 method for class 'geoevgam'
predict(object, model = c("threshold", "excess"), ...)

Arguments

object

An object of class geoevgam.

model

Character vector specifying which component(s) to predict from. Possible values are "threshold" and "excess".

...

Additional arguments passed to the underlying predict.evgam() method, such as newdata, type, or std.err.

Value

If a single model component is requested, the corresponding prediction object returned by predict.evgam(). If multiple components are requested, a named list containing predictions for each requested model component.

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))
data1 <- data.frame(radius = polar1$r, angle = polar1$phi[1, ])

fit1 <- geoevgam(data = data1)

# threshold predictions
pred_thresh <- predict(fit1, model = "threshold")

# exceedance predictions on a grid of angles
newdata <- data.frame(angle = seq(0, 2 * pi, length.out = 100))
pred_excess <- predict(fit1, model = "excess",
                       newdata = newdata, type = "response")

# predictions from both components
pred_both <- predict(fit1,
                     model = c("threshold", "excess"),
                     newdata = newdata)


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