mrl | R Documentation |
Calculate mean residual life and plot it to aid the identification of a threshold over which to fit a generalized Pareto distribution
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 x-axis. Defaults to |
ylab |
Label for the y-axis. Defaults to |
... |
Optional arguments to |
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 |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.