estim_farr.np: Non-parametric estimation of the far

Description Usage Arguments Details Value Examples

View source: R/smallfar_nonpara_sthao.R

Description

estim_farr.np returns an object of class ("farrfit_np", "farrfit") which contains the results of the non-parametric estimation of the far.

Usage

1
estim_farr.np(x, z, rp)

Arguments

x

the variable of interest in the counterfactual world.

z

the variable of interest in the factual world.

rp

the return periods for which the far is to be estimated.

Details

This function returns an non-parametric estimate of the far, the fraction of attributable risk for records, as defined in Naveau et al (2018).

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 ("farrfit_np", "farrfit"). It is a list containing the following elements:

rp

the return periods for which the far is estimated.

farr_hat

the estimate of the far for each return period rp

sigma_farr_hat

the standard deviation of the estimator of the far assuming asymptotic gaussianity

.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 library(evd)

 muF <-  1; xiF <- .15; sigmaF <-  1.412538 #  cst^(-xiF) # .05^(-xi1);
 # asymptotic limit for the farr 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)
 # non-parametric estimation of far
 farr_fit.np <- estim_farr.np(x = x, z = z, rp = rp)
 print(farr_fit.np)
 ylim <- range(boundFrechet, farr_fit.np$farr_hat)
 plot(farr_fit.np, ylim = ylim, main = "far empirical")
 # 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.