Learn R Programming

EGRETci (version 2.0.4)

runGroupsBoot: The bootstrap uncertainty analysis for runGroups results

Description

This function that does the uncertainty analysis for determining the change between two groups of years. The process is virtually identical to what is used for runPairsBoot which looks at a change between a pair of years.

Usage

runGroupsBoot(eList, groupResults, nBoot = 100, startSeed = 494817,
  blockLength = 200, jitterOn = FALSE, V = 0.2)

Arguments

eList

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

groupResults

data frame returned from runGroups

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.

Value

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

  • bootOut is a data frame with the results of the bootstrap test.

  • wordsOut is a character vector describing the results.

  • xConc and xFlux are vectors of length iBoot, of the change in flow normalized concentration and flow normalized flux computed from each of the bootstrap replicates.

  • pConc and pFlux are vectors of length iBoot, of the change in flow normalized concentration or flow normalized flux computed from each of the bootstrap replicates expressed as % change.

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.

See Also

runPairsBoot, runGroups

Examples

Run this code
# NOT RUN {
library(EGRET)
eList <- Choptank_eList

# }
# NOT RUN {
groupResults <- runGroups(eList, 
                          group1firstYear = 1995, 
                          group1lastYear = 2004, 
                          group2firstYear = 2005, 
                          group2lastYear = 2014, 
                          windowSide = 7, wall = TRUE, 
                          sample1EndDate = "2004-10-30", 
                          paStart = 4, paLong = 2, 
                          verbose = FALSE)

boot_group_out <- runGroupsBoot(eList, groupResults)

plotHistogramTrend(eList, boot_group_out, caseSetUp=NA)
# }

Run the code above in your browser using DataLab