confint.boot_farrfit: Compute confidence intervals from bootstrap samples of the...

Description Usage Arguments Details Value Examples

View source: R/smallfar_para_sthao.R

Description

confint.boot_farrfit returns an matrix that contains the confidence interval for the far computed empirically from the bootstrap estimates of the far for different return periods rp

Usage

1
2
3
## S3 method for class 'boot_farrfit'
confint(object, parm = dimnames(object)$rp,
  level = 0.95, ...)

Arguments

object

an object with the class boot_farrfit. It is a matrix containing the bootstrap samples of the far. Each line of this matrix represent the estimated far for different return periods rp and colum corresponds to a differents bootstrap samples of the data.

parm

a vector of return levels for which to compute the confidence interval for the far. The return levels have to be selected from the one present in rownames(object).

level

a numerical value between 0 and 1 corresponding to the confidence level of the confidence intervals.

...

not used.

Details

This function returns a two-column matrix that contains the confidence intervals for the far computed empirically from the bootstrap estimates of the far.

Value

A two-column matrix that contains the confidence interval for the far computed empirically from the bootstrap estimates of the far. The first colum is for the lower bound of the confidence interval and the second one for the upper bound. Each line of the matrix represents the condidence interval for a different return period rp

Examples

 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
 library(evd)

 muF <-  1; xiF <- .15; sigmaF <-  1.412538 #  cst^(-xiF) # .05^(-xi1);
 # asymptotic limit for the far in this case with a Frechet distributiom
 boundFrechet <- frechet_lim(sigma = sigmaF, xi = xiF)
 # sample size
 size <- 100
 # level=.9
 set.seed(4)
 z = rgev(size, loc = (sigmaF), scale = xiF * sigmaF, shape = xiF)
 x = rgev(length(z), loc=(1), scale = xiF, shape=xiF)

 rp = seq(from = 2, to = 30, length = 200)
 # Resampling bootstrap for estimation of far assuming an exponential distribution for theta
 theta_boot.exp <- boot_theta_fit.wexp(x = x, z = z, B = 10)

 # Estimate the far from the bootstrap samples of theta
 boot_farr.exp <- boot_farr_fit.wexp(theta_boot = theta_boot.exp$theta_boot , rp = rp)
 confint(boot_farr.exp)
 print(boot_farr.exp)
 ylim <- range(boundFrechet, boot_farr.exp)
 plot(boot_farr.exp, ylim = ylim, main = "boot far exponential")
 # Theoretical for in this case (Z = sigmaF * X  with X ~ Frechet)
lines(rp, frechet_farr(r = rp, sigma = sigmaF, xi = xiF), col = "red", lty = 2)
 abline(h = boundFrechet, col = "red", lty = 2)

thaos/farr documentation built on May 28, 2019, 8:42 a.m.