make_compute_far: Creates function to co compute the FAR

Description Usage Arguments Value Examples

Description

make_compute_far creates a function to compute the FAR by choosing an EBM simulation function and a method to decompose the covariate x into an ANT and a NAT

List of already created compute_far functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
make_compute_far(ebm_bsamples = ebm_bsamples.default, ebm_args = list(model
  = "cnrm"), decompose_x = dx.gam_allnat, dx_args = list())

compute_far.default(model, y = "y", x = "x", time = "time", xp = 1.6,
  R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

compute_far.sf_gaussian(model, y = "y", x = "x", time = "time",
  xp = 1.6, R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

compute_far.sf_gaussian.dx_raw(model, y = "y", x = "x", time = "time",
  xp = 1.6, R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

compute_far.sf_gaussian.dx_lm_gno(model, y = "y", x = "x", time = "time",
  xp = 1.6, R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

compute_far.sf_gaussian.dx_gam_gno(model, y = "y", x = "x", time = "time",
  xp = 1.6, R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

compute_far.dx_ebm_fit(model, y = "y", x = "x", time = "time", xp = 1.6,
  R = 3, stat_model = gauss_fit, ci_p = 0.9, ...)

Arguments

ebm_bsamples

a function to simulates the EBM responses. it should return a list of two list :

  • bsamples : a list of data.frame with the original dataset merged with the bootstrap EBM simulations

  • bindexes : a list of vectors of indexes indicating the rows that will be used for the bootstrap

ebm_args

a list of argument to be used in the ebm_bsamples. It can be an expression if the variable in the list need to be evaluate within the compute_far function(Non-Standard-Evaluation NSE)

decompose_x

a function to decompose the covariate x into an ALL, an ANT and a NAT component. It has to takes as argument bsamples and bindexes which results of the ebm_samples functions

dx_args

a list of argument to be used in the ebm_bsamples. It can be

Value

a function with the following arguments :

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# creates a variante of the computing chain with the following properties 
# EBM simulations: 
# - takes model parameters if available, else takes a set of available
# parameters at random
# - random  scaling factors
# Decompose x:
# -  modèle gam :x_all = beta_nat * nat + s(ant)
# - shift mean(ant) to 0 between 1850 and 1879
compute_far.default <- make_compute_far(ebm_bsamples=ebm_bsamples.default,
                                              ebm_args=expression(list(
                                                                     model=model,
                                                                   mdata=mdata
                                                                 ))
                                      )
library(FARg)
ans <- compute_far.default(model="cnrm", y="eur_tas", x="gbl_tas", time="year", xp=1.6, stat_model=gauss_fit, ci_p=0.9)

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