Description Usage Arguments Details Value References See Also Examples
predict
method for class "ithresh". Predictive inferences can
either be based on a single training threshold or using a weighted
average of inferences over multiple training thresholds. A single
threshold may chosen to be the best performing threshold, as judged by the
measure of predictive performance calculated by ithresh
or
chosen by the user. The weights used in the latter case are based on the
measures of predictive performance and prior probabilities assigned to the
training thresholds. By default all thresholds are given the same
prior probability but the user can specify their own prior.
1 2 3 4 
object 
An object of class "ithresh", a result of a call to

npy 
A numeric scalar. The mean number of observations per year of data, after excluding any missing values, i.e. the number of nonmissing observations divided by total number of years of nonmissing data. 
n_years 
A numeric vector. Value(s) of N. If 
which_u 
Either a character scalar or a numeric scalar.
If If If Otherwise, 
which_v 
A numeric scalar. Indicates which element of

u_prior 
A numeric vector. Prior probabilities for the training
thresholds in Only the first
If 
type 
A character vector.
Passed to
If 
x 
A numeric vector. The argument 
... 
Additional optional arguments. At present no optional arguments are used. 
The function predict.evpost
is used to
perform predictive based on the binomialGP posterior sample generated
using a given training threshold. For mathematical details of the
single threshold and multiple threshold cases see Sections 2.3 and 3 of
Northrop et al. (2017)
respectively.
An list object of class "ithreshpred" with a similar structure to
an object of class "evpred" returned from
predict.evpost
is returned invisibly.
In addition, the object contains
u_vec = object$u_vec
and v_vec = object$v_vec
,
which_v
and the index best_u
in
u_vec = object$u_vec
of the best training threshold based on
the value of which_v
.
If which_u == "all"
then
the list also contains the posterior threshold weights
in component post_thresh_wts
the component y
is a matrix with length{x}
rows
and 1 + length(object$u_vec)  length(object$v_vec) + which_v
columns. Column 1 contains the estimated predictive distribution
function (type = "p"
) or density function (type = "d"
)
obtained using a weighted average of the inferences over different
training thresholds. The other columns contain the estimated
functions for each of the training thresholds in u_vec
.
Northrop, P. J., Attalides, N. and Jonathan, P. (2017) Crossvalidatory extreme value threshold selection and uncertainty with application to ocean storm severity. Journal of the Royal Statistical Society Series C: Applied Statistics, 66(1), 93120. http://dx.doi.org/10.1111/rssc.12159
ithresh
for threshold selection in the i.i.d. case
based on leaveoneout crossvalidation.
plot.ithreshpred
for the S3 plot method for objects
of class ithreshpred
.
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  # Note:
#' In the examples below validation thresholds rather higher than is
# advisable have been used, with far fewer excesses than the minimum of
# 50 suggested by Jonathan and Ewans (2013).
# Gulf of Mexico significant wave heights, default priors.
u_vec_gom < quantile(gom, probs = seq(0, 0.95, by = 0.05))
gom_cv < ithresh(data = gom, u_vec = u_vec_gom, n_v = 4)
# Note: gom_cv$npy contains the correct value of npy (it was set in the
# call to ithresh, via attr(gom, "npy").
# If object$npy doesn't exist then the argument npy must be supplied
# in the call to predict().
### Best training threshold based on the lowest validation threshold
# Predictive distribution function
best_p < predict(gom_cv, n_years = c(100, 1000))
plot(best_p)
# Predictive density function
best_d < predict(gom_cv, type = "d", n_years = c(100, 1000))
plot(best_d)
# See which threshold was used
summary(gom_cv)
### All thresholds plus weighted average of inferences over all thresholds
# Predictive distribution function
all_p < predict(gom_cv, which_u = "all")
plot(all_p)
# Predictive density function
all_d < predict(gom_cv, which_u = "all", type = "d")
plot(all_d)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.