runPairsBoot {EGRETci}R Documentation

The bootstrap uncertainty analysis for runPairs results

Description

The function that does the uncertainty analysis for determining the change between any pair of years. It is very similar to the wBT function that runs the WRTDS bootstrap test. It differs from wBT in that it runs a specific number of bootstrap replicates, unlike the wBT approach that will stop running replicates based on the status of the test statistics along the way. Also, this code can be used with generalized flow normalization, which handles non-stationary discharge, whereas wBT does not.

Usage

runPairsBoot(eList, pairResults, nBoot = 100, startSeed = 494817,
  blockLength = 200, jitterOn = FALSE, V = 0.2)

Arguments

eList

named list with at least the Daily, Sample, and INFO dataframes

pairResults

data frame returned from runPairs

nBoot

the maximum number of bootstrap replicates to be used, typically 100

startSeed

setSeed value. Defaults to 494817. This is used to make repeatable output.

blockLength

days, typically 200 is a good choice

jitterOn

logical, if TRUE, adds "jitter" to the data in an attempt to avoid some numerical problems. Default = FALSE. See Details below.

V

numeric a multiplier for addition of jitter to the data, default = 0.2.

Details

In some situations numerical problems are encountered in the bootstrap process, resulting in highly unreasonable spikes in the confidence intervals. The use of "jitter" can often prevent these problems, but should only be used when it is clearly needed. It adds a small amount of random "jitter" to the explanatory variables of the WRTDS model. The V parameter sets the scale of variation in the log discharge values. The standard deviation of the added jitter is V * standard deviation of Log Q. The default for V is 0.2. Larger values should generally be avoided, and smaller values may be sufficient.

Value

eBoot, a named list with bootOut, wordsOut, xConc, xFlux, pConc, pFlux values.

See Also

runGroupsBoot, runPairs

Examples

library(EGRET)
eList <- Choptank_eList
year1 <- 1985
year2 <- 2009

## Not run: 
pairOut_2 <- runPairs(eList, year1, year2, windowSide = 7)

boot_pair_out <- runPairsBoot(eList, pairOut_2)

plotHistogramTrend(eList, boot_pair_out, caseSetUp = NA)

## End(Not run)

[Package EGRETci version 2.0.4 Index]