Learn R Programming

texmex (version 2.4.9)

mrl: Mean residual life plot

Description

Calculate mean residual life and plot it to aid the identification of a threshold over which to fit a generalized Pareto distribution

Usage

mrl(data, umin = min(data), umax = max(data) - 0.1, nint = 100,
alpha=.050)
# S3 method for mrl
print(x, ...)
# S3 method for summary.mrl
print(x, ...)
# S3 method for mrl
summary(object, ...)
# S3 method for mrl
plot(x, xlab="Threshold", ylab="Mean excess", ...)
# S3 method for mrl
ggplot(data, mapping, xlab = "Threshold",
  ylab = "Mean excess", main=NULL,fill="orange", col="blue",
  rug=TRUE, addNexcesses=TRUE, textsize=4, ..., environment)

Value

A list with two components. data is the original data, mrl is a matrix containing information to produce the mean residual life plot.

Arguments

data

A numeric vector.

umin

The minimum value over which to threshold the data.

umax

The maximum value over which to threshold the data.

nint

The number of points at which to compute the plot.

alpha

Used to determine coverage of confidence interval to plot. Defaults to plotting a 95% interval.

x, object

Arguments to print, summary and plot functions.

xlab

Label for the x-axis. Defaults to xlab="Threshold".

ylab

Label for the y-axis. Defaults to ylab="Mean excess".

...

Optional arguments to plot.

col

Colour of the line on the MRL plot.

rug

Whether to add raw data as a rug along axis of plot.

fill

Colour of the pointwise confidence region on the MRL plot.

main

Main title.

addNexcesses

Whether to annotate the plot with the numbers of excesses over increasing thresholds. Defaults to addNexcesses=TRUE.

textsize

Size of text on the plot (ggplot). Defaults to textsize=4.

mapping, environment

Not used.

Author

Janet E. Heffernan, Harry Southworth

Details

Threshold choice for the fitting of the GPD is guided by the shape of the Mean Residual Life plot. A threshold which is suitably high will have a corresponding mrl plot which is approximately linear in shape above the threshold (up to sampling variation).

References

S. Coles, An Introduction to Statistical Modeling of Extreme Values, Springer, 2001