Learn R Programming

extRemes (version 2.2)

ci.rl.ns.fevd.bayesian: Confidence/Credible Intervals for Effective Return Levels

Description

Calculates credible intervals based on the upper and lower alpha/2 quantiles of the MCMC sample for effective return levels from a non-stationary EVD fit using Bayesian estimation, or find normal approximation confidence intervals if estimation method is MLE.

Usage

# S3 method for rl.ns.fevd.bayesian
ci(x, alpha = 0.05, return.period = 100, FUN = "mean",
                 burn.in = 499, ..., qcov = NULL, qcov.base = NULL,
                 verbose = FALSE)

# S3 method for rl.ns.fevd.mle ci(x, alpha = 0.05, return.period = 100, method = c("normal"), verbose = FALSE, qcov = NULL, qcov.base = NULL, ...)

Value

A three-column matrix is returned with the estimated effective return levels in the middle and lower and upper to the left and right.

Arguments

x

An object of class “fevd”.

alpha

Confidence level (numeric).

return.period

numeric giving the desired return period. Must have length one!

FUN

character string naming the function to use to calculate the estimated return levels from the posterior sample (default takes the posterior mean).

burn.in

The first burn.in iterations will be removed from the posterior sample before calculating anything.

method

Currently only “normal” method is implemented.

verbose

logical, should progress information be printed to the screen? Currently not used by the MLE method.

...

Not used.

qcov, qcov.base

Matrix giving specific covariate values. qcov.base is used if difference betwen effective return levels for two (or more) sets of covariates is desired, where it is rl(qcov) - rl(qcov.base). See make.qcov for more details. If not supplied, effective return levels are calculated for all of the original covariate values used for the fit. If qcov.base is not NULL but qcov is NULL, then qcov takes on the values of qcov.base and qcov.base is set to NULL, and a warning message is produced.

Author

Eric Gilleland

Details

Return levels are calculated for all coavariates supplied by qcov (and, if desired, qcov.base) for all values of the posterior sample (less the burn.in), or for all values of the original covariates used for the fit (if qcov and qcov.base are NULL). The estimates aree taken from the sample according to FUN and credible intervals are returned according to alpha.

See Also

make.qcov, fevd, ci.fevd, return.level

Examples

Run this code
data(Fort)
fit <- fevd(Prec, threshold = 2, data = Fort,
    location.fun = ~cos(2 * pi * day /365.25),
    type = "PP", verbose = TRUE)

v <- make.qcov(fit, vals=list(mu1 = c(cos(2 * pi * 1 /365.25),
    cos(2 * pi * 120 /365.25), cos(2 * pi * 360 /365.25))))

ci(fit, return.period = 100, qcov = v)

if (FALSE) {
fit <- fevd(Prec, threshold = 2, data = Fort,
    location.fun = ~cos(2 * day /365.25),
    type = "PP", method = "Bayesian", verbose = TRUE)

ci(fit, return.period = 100, qcov = v)
}

Run the code above in your browser using DataLab