get_far: get_far generic.

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/get_far.R

Description

Compute the FAR.

Usage

1
2
3
4
5
6
7
get_far(object, ...)

## S3 method for class 'gpd_fit'
get_far(object, pnt0, pnt1, under_threshold = FALSE, ...)

## Default S3 method:
get_far(object, pnt0, pnt1, ...)

Arguments

object

an object of class gauss_fit, gev_fit, gpd_fit or of class trans. If object is of class trans, the argument y_fit must be passed.

...

Arguments to be passed to methods,

pnt0

point at time t0. A point is defined by a time, a threshold xp and values of covariates used for the fit.

pnt1

point at time t1. A point is defined by a time, a threshold xp and values of covariates used for the fit.

under_threshold

used for gpd_fit. It tells whether it provides an estimated when one of points is under the GPD threshold. In which case, gives the empirical probability obtained by quantile regression.

Details

Compute the Fraction of Attributable Risk, which compares the probabilities p0 and p1 of exeeding a threshold xp at two differents time (t0 and t1) of the times series : FAR = 1 - p0/p1.

Value

a vector with the estimated confidence intervals for the far as well as the probability of exceeding the threshold xp and the models parameters a both time t0 and t1.

Methods (by class)

Examples

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

ge_fit <- gev_fit(eur_tas, data=tas, mu_mod=~gbl_tas, sig_mod=~gbl_tas, time_var="year")
gp_fit <- gpd_fit(eur_tas, data=tas, mu_mod=~gbl_tas, sig_mod=~gbl_tas, time_var="year", qthreshold=0.9)
ga_fit <- gauss_fit(eur_tas, data=tas, mu_mod=~gbl_tas, sig_mod=~gbl_tas, time_var="year")

t1 <- 2003
t0 <- 1990
xp <- 1.6
pnt1 <- set_pnt(t1, xp, time_var="year", tas)
pnt0 <- set_pnt(t0, xp, time_var="year", tas)

get_p(ga_fit ,pnt1)
get_far(ga_fit, pnt0, pnt1)

get_p(gp_fit, pnt1)
get_far(gp_fit, pnt0, pnt1)

get_p(ge_fit, pnt1)
get_far(ge_fit, pnt0, pnt1)

thaos/FARg documentation built on May 25, 2019, 8:18 a.m.