plot.ithresh {threshr} | R Documentation |
Plot diagnostics an ithresh object
Description
plot
method for class "ithresh"
. Produces an extreme value
threshold diagnostic plot based on an analysis performed by
ithresh
. Can also be used to produce a plot of
the posterior sample generated by ithresh
for a particular
training threshold.
Usage
## S3 method for class 'ithresh'
plot(
x,
y,
...,
which_v = NULL,
prob = TRUE,
top_scale = TRUE,
add_legend = FALSE,
legend_pos = "topleft",
which_u = NULL
)
Arguments
x |
an object of class |
y |
Not used. |
... |
Additional arguments passed on to |
which_v |
A numeric scalar or vector. If If |
prob |
A logical scalar. If |
top_scale |
A logical scalar indicating Whether or not to add a scale
to the top horizontal axis. If this is added it gives the threshold on
the scale not chosen by |
add_legend |
A logical scalar indicating whether or not to add a
legend to the plot. If |
legend_pos |
The position of the legend (if required) specified using
the argument |
which_u |
Either a character scalar or a numeric scalar.
If If Otherwise, |
Details
Produces plots of the threshold weights, defined in
equation (14) of Northrop et al. (2017) against training threshold. A line
is produced for each of the validation thresholds chosen in which_v
.
The result is a plot like those in the top row of Figure 7 in
Northrop et al. (2017).
It is possible that a curve on the plot may be incomplete. This indicates
that, for a particular threshold level, a measure of predictive
performance is -Inf
. This occurs when an observation in the data
lies above the estimated upper end point of the predictive distribution
produced when this observation is removed.
Value
If which_u
is supplied then the object with which
plot.evpost
was called is returned (invisibly).
Otherwise, a list is returned (again invisibly) with two components.
x
is a vector containing the coordinates plotted on the
(lower) horizontal axis.
y
is an length(u_vec)
by n_v
matrix of
threshold weights obtained by normalising the columns of the
matrix pred_perf
returned by ithresh
.
See equation (14) of Northrop et al. (2017).
See Also
ithresh
for threshold selection in the i.i.d. case
based on leave-one-out cross-validation.
summary.ithresh
Summarizing measures of threshold
predictive performance.
print.ithresh
Prints the threshold weights.
predict.ithresh
for predictive inference for the
largest value observed in N years.
Examples
# [Smoother plots result from making n larger than the default n = 1000.]
# Threshold diagnostic plot
u_vec_gom <- quantile(gom, probs = seq(0, 0.9, by = 0.05))
gom_cv <- ithresh(data = gom, u_vec = u_vec_gom, n_v = 3)
plot(gom_cv, lwd = 2, add_legend = TRUE, legend_pos = "topleft")
mtext("significant wave height / m", side = 3, line = 2.5)
# Plot of Generalized Pareto posterior sample at the best threshold
# (based on the lowest validation threshold)
plot(gom_cv, which_u = "best")
# See which threshold was used
summary(gom_cv)
# Plot of Generalized Pareto posterior sample at the highest threshold
n_u <- length(u_vec_gom)
plot(gom_cv, which_u = n_u, points_par = list(pch = 20, col = "grey"))