GEV_shape_plot: Fitted GEV Shape as a Function of the Threshold

View source: R/BMM.R

GEV_shape_plotR Documentation

Fitted GEV Shape as a Function of the Threshold

Description

Fit GEVs to block maxima and plot the fitted GPD shape as a function of the block size.

Usage

GEV_shape_plot(x, blocksize = tail(pretty(seq_len(length(x)/20), n = 64), -1),
               estimate.cov = TRUE, conf.level = 0.95,
               CI.col = adjustcolor(1, alpha.f = 0.2),
               lines.args = list(), xlim = NULL, ylim = NULL,
               xlab = "Block size",  ylab = NULL,
               xlab2 = "Number of blocks", plot = TRUE, ...)

Arguments

x

vector of numeric data.

blocksize

numeric vector of block sizes for which to fit a GEV to the block maxima.

estimate.cov

logical indicating whether confidence intervals are to be computed.

conf.level

confidence level of the confidence intervals if estimate.cov.

CI.col

color of the pointwise asymptotic confidence intervals (CIs); if NA, no CIs are shown.

lines.args

list of arguments passed to the underlying lines() for drawing the shape parameter as a function of the block size.

xlim, ylim, xlab, ylab

see plot().

xlab2

label of the secondary x-axis.

plot

logical indicating whether a plot is produced.

...

additional arguments passed to the underlying plot().

Details

Such plots can be used in the block maxima method for determining the optimal block size (as the smallest after which the plot is (roughly) stable).

Value

Invisibly returns a list containing the block sizes considered, the corresponding block maxima and the fitted GEV distribution objects as returned by the underlying fit_GEV_MLE().

Author(s)

Marius Hofert

Examples

set.seed(271)
X <- rPar(5e4, shape = 4)
GEV_shape_plot(X)
abline(h = 1/4, lty = 3) # theoretical xi = 1/shape for Pareto

qrmtools documentation built on March 19, 2024, 3:08 a.m.