add_param: Adds a parameter to the the array containing the bootstrap...

Description Usage Arguments Value Examples

Description

Adds a parameter to the the array containing the bootstrap results. The added parameters if computed as a function of the parameters amready presents. The function uses non-standard evaluation to compute the new parameters. For instance, the FAR could be computed from the probabilities p_all and p_nat.

Usage

1
add_param(b_onperiod, operation, name)

Arguments

b_onperiod

array containing the estimates from the bootstrap samples.

operation

an expression telling how to compute the new parameter from the others parameters.

name

the name of the new parameters as it appears in the boootstrap array

Value

returns the bootstrap array with the additional row containg the new parameters computed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(FARg)
model <- "cnrm"
#load data from the package
data(list=model)
# formating data, e.g passing from temperature to anomalie, keep only hist
# and rcp runs
mdata <- format_data(get(model))
if(model != "obs") mdata <- select_continuous_run(mdata)
ans <- compute_far_simple.default(mdata,
 y="eur_tas", x="gbl_tas", time="year",
  xp=1.6, stat_model=gauss_fit, ci_p=0.9)
# get bootstrap samples of p_all p_nat and p_ant
bp <- ans$allp
# compute the evolution of p_all relatively to its value in 1850
bp  <- add_param(bp, operation=p_all/p_all[time==1850], name="p_all_rel")
# create the 0.95 confidence intervals data.frame
ic  <- get_ic_onperiod(bp, ci=0.95)

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