estimate_confidence: estimate_confidence estimate confidence intervals for choc...

View source: R/estimate_confidence.R

estimate_confidenceR Documentation

estimate_confidence estimate confidence intervals for choc analysis

Description

estimate_confidence estimate confidence intervals for choc analysis

Usage

estimate_confidence(
  mychoc,
  method = "perm",
  conf = 0.95,
  nb_replicates = 500,
  ncores = 1,
  progressbar = TRUE
)

Arguments

mychoc

a list as returned by choc

method

either "perm" (default) or "kern", see details

conf

size of the confidence interval

nb_replicates

number of replicates used to assess confidence intervals

ncores

Number of cores used. The parallelization will take place only if OpenMP is supported (default 1)

progressbar

(default TRUE) show progressbar (might be a bit slower)

Value

an updated version of mychoc with two columns added to mychoc$grid which corresponds to the bounds of the confidence interval

Details

Two methods are available: perm permutates the kernell per time step and estimates Kendall tau on permutations. kern fits a kernell on the whole dataset (assuming that there is not time trend) and uses this overall kernell to generate surrogate data sets on which kendall tau are estimated. Permutations is a good solution when there is seasonnality within time step to preserve internal seasonality, however, it requires more time steps. kern is a good solution when there is no seasonnality within time step or when the number of observations per time step is important enough.

Examples

#retrieve results of a choc function
data(res_choc)
#here we put a low number of replicates to limit computation time
#res_confid <- estimate_confidence(res_choc,"perm",0.95,50)


Irstea/chocR documentation built on June 12, 2022, 8:28 p.m.