predict.evgam: Predictions from a fitted 'evgam' object

View source: R/predict.R

predict.evgamR Documentation

Predictions from a fitted evgam object

Description

Predictions from a fitted evgam object

Usage

## S3 method for class 'evgam'
predict(
  object,
  newdata,
  type = "link",
  prob = NULL,
  se.fit = FALSE,
  marginal = TRUE,
  exi = FALSE,
  trace = 0,
  ...
)

Arguments

object

a fitted evgam object

newdata

a data frame

type

a character string giving the type of prediction sought; see Details. Defaults to "link"

prob

a scalar or vector of probabilities for quantiles to be estimated if type == "quantile"; defaults to 0.5

se.fit

a logical: should estimated standard errors be returned? Defaults to FALSE

marginal

a logical: should uncertainty estimates integrate out smoothing parameter uncertainty? Defaults to TRUE

exi

a logical: if a dependent GEV is fitted should the independent parameters be returned? Defaults to FALSE

trace

an integer where higher values give more output. -1 suppresses everything. Defaults to 0

...

unused

Details

There are five options for type: 1) "link" distribution parameters transformed to their model fitting scale; 2) "response" as 1), but on their original scale; 3) "lpmatrix" a list of design matrices; 4) "quantile" estimates of distribution quantile(s); and 5) "qqplot" a quantile-quantile plot.

Value

A data frame or list of predictions, or a plot if type == "qqplot"

References

Youngman, B. D. (2022). evgam: An R Package for Generalized Additive Extreme Value Modules. Journal of Statistical Software. To appear. doi: 10.18637/jss.v103.i03

Examples


data(fremantle)
fmla_gev <- list(SeaLevel ~ s(Year, k=5, bs="cr"), ~ 1, ~ 1)
m_gev <- evgam(fmla_gev, fremantle, family = "gev")
# prediction of link GEV parameter for fremantle data
predict(m_gev)
# predictions for Year 1989
y1989 <- data.frame(Year = 1989)
# link GEV parameter predictions
predict(m_gev, y1989)
# GEV parameter predictions
predict(m_gev, y1989, type= "response")
# 10-year return level predictions
predict(m_gev, y1989, type= "quantile", prob = .9)
# 10- and 100-year return level predictions
predict(m_gev, y1989, type= "quantile", prob = c(.9, .99))


evgam documentation built on June 28, 2022, 5:07 p.m.

Related to predict.evgam in evgam...