rl: Return levels

Description Usage Arguments Details Examples

View source: R/predict.gpd.R

Description

Computation of return levels and confidence intervals for generalized Pareto distributions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
rl(object, M = 1000, newdata = NULL, se.fit = FALSE, ci.fit = FALSE, 
   alpha = 0.050, unique. = TRUE, ...)
   
## S3 method for class 'gpd'
rl(object, M = 1000, newdata = NULL, se.fit = FALSE, ci.fit = FALSE, 
   alpha = 0.050, unique. = TRUE, ...)
## S3 method for class 'bgpd'
rl(object, M = 1000, newdata = NULL, se.fit = FALSE, ci.fit = FALSE, 
   alpha = 0.050, unique. = TRUE, all = FALSE, sumfun = NULL, ...)
## S3 method for class 'bootgpd'
rl(object, M = 1000, newdata = NULL, se.fit = FALSE, ci.fit = FALSE, 
   alpha = 0.050, unique. = TRUE, all = FALSE, sumfun = NULL, ...)

## S3 method for class 'rl.gpd'
plot(x, xlab, ylab, main, pch= 1, ptcol =2 , cex=.75, linecol = 4 , 
     cicol = 0, polycol = 15, smooth = TRUE, sameAxes=TRUE, type="median", ... )
## S3 method for class 'rl.bgpd'
plot(x, xlab, ylab, main, pch= 1, ptcol =2 , cex=.75, linecol = 4 , 
     cicol = 0, polycol = 15, smooth = TRUE, sameAxes=TRUE, type="median", ... )
## S3 method for class 'rl.bootgpd'
plot(x, xlab, ylab, main, pch= 1, ptcol =2 , cex=.75, linecol = 4 , 
     cicol = 0, polycol = 15, smooth = TRUE, sameAxes=TRUE, type="median", ... )

## S3 method for class 'rl.gpd'
print(x, digits=3, ...)
## S3 method for class 'rl.bgpd'
print(x, digits=3, ...)
## S3 method for class 'rl.bootgpd'
print(x, digits=3, ...)

## S3 method for class 'rl.gpd'
summary(object, digits=3, ...)
## S3 method for class 'rl.bgpd'
summary(object, digits=3, ...)
## S3 method for class 'rl.bootgpd'
summary(object, digits=3, ...)

Arguments

object

An object of class gpd, bgpd or bootgpd.

M

The M-observation return level is computed by the function. Defaults to M = 1000.

newdata

Data from which to calculate the return level. If not provided, the original data used to fit the model is used. Column names must match those of original data matrix used for model fitting.

se.fit

Whether or not to return the standard error of the predicted value. Defaults to se.fit = FALSE.

ci.fit

Whether or not to return a confidence interval for the predicted value. Defaults to ci.fit = FALSE. For objects of class gpd, if set to TRUE then the confidence interval is a simple symmetric confidence interval based on the estimated approximate standard error. For the bgpd and bootgpd methods, the confidence interval represents quantiles of the simulated distribution of the parameters.

alpha

If ci.fit = TRUE, a (1 - alpha)% confidence interval is returned. Defaults to alpha = 0.050.

unique.

If unique. = TRUE, predictions for only the unique values of the linear predictors are returned, rather than for every row of the original dataframe or of newdata if this latter is specified. Defaults to unique. = TRUE.

all

For the bgpd and bootgpd methods, if all = TRUE, the predictions are returned for every simulated parameter vector. Otherwise, only a summary of the posterior/bootstrap distribution is returned. Defaults to all = FALSE.

sumfun

For the bgpd and bootgpd methods, a summary function can be passed in. If sumfun = FALSE, the default, the summary function used returns the estimated mean and median, and quantiles implied by alpha.

type

For calls to plot methods for objects of class rl.bgpd or rl.bootgpd, specifies whether to use the sample mean (type="mean") or median (type="median") estimate of the return levels.

x

Object passed to plot and print methods.

xlab, ylab, main, pch, ptcol, cex, linecol, cicol, polycol, smooth, sameAxes

Further arguments to plot methods.

digits

Number of digits to show when printing output.

...

Further arguments to be passed to methods.

Details

The M-observation return level is defined as the value that is expected to be exceeded only once every M observations. Thus, it is an estimate of a high quantile of the fitted distribution. In models fit by the gpd family of functions, only a fraction of the data is actually included in the model; the fitted GPD is a conditional model, conditioning on the threshold having been exceeded. This consideration is taken into account by rl which calculates unconditional return levels from the entire distribution of observations above and below the GPD fitting threshold.

Examples

1
2
mod <- gpd(rain, qu=.8) # daily rainfall observations
rl(mod, M=100*365) # 100-year return level

texmex documentation built on May 2, 2019, 4:56 p.m.