estim_farr.wexp: Parametric estimation of the far under W ~ exp(theta)

Description Usage Arguments Details Value Examples

View source: R/smallfar_para_sthao.R

Description

estim_farr.wexp returns an object of class ("farrfit_wexp", "farrfit") which contains the results of the estimation of the far assuming W ~ exp(theta).

Usage

1
2
3
4
5
6
7
estim_farr.wexp(theta_hat, sigma_theta_hat, rp)

## S3 method for class 'farrfit'
print(x, ...)

## S3 method for class 'farrfit'
plot(x, ...)

Arguments

theta_hat

the value of the estimated theta. The estimation of theta is made assuming W ~ exp(theta). This vector is provided by the function estim_theta.wexp

sigma_theta_hat

the value the estimated standard devitation of theta_hat this vector is provided by the function estim_theta.wexp

rp

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

x

an object of class ("farfit")

...

additional arguments for the plot.

Details

This function returns an estimate of the 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.

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

rp

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

farr_hat

the estimated far for each return period rp

sigma__hat

the standard deviation of the estimator of the far assuming asymptotic gaussianity and obtained via the delta-method from sigma_theta_hat

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
26
27
28
29
30
 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)
 # parametric estimation of far with exponential distribution for theta
 theta_fit <- estim_theta.wexp(x = x, z = z)
 # Check fit for W ~ exp(theta)
 hist(theta_fit)
 ecdf(theta_fit)
 qqplot(theta_fit)

 # Estimate the far
 farr_fit.exp <- estim_farr.wexp(theta_hat = theta_fit$theta_hat,
  sigma_theta_hat = theta_fit$sigma_theta_hat,
  rp = rp)
 print(farr_fit.exp)
 ylim <- range(boundFrechet, farr_fit.exp$farr_hat)
 plot(farr_fit.exp, ylim = ylim, main = "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.