Calculate mean residual life and plot it to aid the identification of a threshold over which to fit a generalized Pareto distribution
1 2 3 4 5 6 7 8 9 10 11 12 13 14  mrl(data, umin = min(data), umax = max(data)  0.1, nint = 100,
alpha=.050)
## S3 method for class 'mrl'
print(x, ...)
## S3 method for class 'summary.mrl'
print(x, ...)
## S3 method for class 'mrl'
summary(object, ...)
## S3 method for class 'mrl'
plot(x, xlab="Threshold", ylab="Mean excess", ...)
## S3 method for class 'mrl'
ggplot(data, mapping, xlab="Threshold", ylab="Mean excess",
main=NULL, fill="orange", col="blue", rug=TRUE, addNexcesses = TRUE, textsize=4,
..., environment)

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 xaxis. Defaults to 
ylab 
Label for the yaxis. Defaults to 
... 
Optional arguments to 
col 
Colour of the line on the MRL plot. 
rug 
Whether to add a rug to the plot. Defaults to 
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 
textsize 
Size of text on the plot (ggplot). Defaults to

mapping, environment 
Not used. 
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).
A list with two components. data
is the original data,
mrl
is a matrix containing information to produce the mean residual
life plot.
The function was originally written by Stuart Coles and appears in the
ismev
package. This version modified by Harry Southworth to allow
more control over the appearance of the plot.
Janet E. Heffernan, Harry Southworth
S. Coles, An Introduction to Statistical Modeling of Extreme Values, Springer, 2001
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.