boot_farr_fit.wexp: Parametric estimation of the far from bootstrap samples of...

Description Usage Arguments Details Value Examples

View source: R/smallfar_para_sthao.R

Description

boot_farr_fit.wexp returns an object of class ("boot_farrfit.wexp", "boot_farrfit", "farrfit") which contains the estimates of the far for each bootstrap sample and for different return periods rp

Usage

1
boot_farr_fit.wexp(theta_boot, rp)

Arguments

theta_boot

the results obtained from the function boot_theta_fit.wexp.

rp

the return periods for which theta is to be estimated.

Details

This function returns bootstrap estimates of far, the fraction of attributable risk for records, as defined in Naveau et al (2018). This estimation is made assuming that W = - log(G(Z)) follows an exponentional distribution: W ~ exp(theta). G denotes the Cumulative Distribution Function of the counterfactual variable X. The far is estimate from the bootstrap samples of theta that are obtained by resampling bootstrap. The first bootrtrap sample corresponds to the original dataset of x and y.

For the full reference, see : Naveau, P., Ribes, A., Zwiers, F., Hannart, A., Tuel, A., & Yiou, P. Revising return periods for record events in a climate event attribution context. J. Clim., 2018., https://doi.org/10.1175/JCLI-D-16-0752.1

Value

An object of class ("boot_farrfit.wexp", "boot_farrfit", "farrfit"). It is a matrix where each columm contains the far estimated for the returns periods rp for a given bootstrap sample.

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 the 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.