Skip to contents

This function takes the output from genDailyBoot and calculates the quantiles for an annual (based on paStart/paLong) aggregation. This means that the function can be used for seasons.

Usage

makeAnnualPI(dailyBootOut, eList, paLong = 12, paStart = 10,
  fluxUnit = 3)

Arguments

dailyBootOut

data frame returned from genDailyBoot

eList

named list with at least the Daily, Sample, and INFO dataframes. Created from the EGRET package, after running modelEstimation.

paLong

numeric integer specifying the length of the period of analysis, in months, 1<=paLong<=12, default is 12

paStart

numeric integer specifying the starting month for the period of analysis, 1<=paStart<=12, default is 10

fluxUnit

number representing entry in pre-defined fluxUnit class array. printFluxUnitCheatSheet

Value

a list of 2 data frames, one for average concentration, in mg/L and one for flux (unit depends on fluxUnit argument) In each data frame the first column is DecYear. The remaining columns are quantiles of the flux or concentration (depending on the data frame).

Examples

eList <- EGRET::Choptank_eList
# This example is only based on 4 iterations
# Actual prediction intervals should be calculated on
# a much larger number of iterations (several hundred).  
dailyBoot <- Choptank_dailyBootOut
annualPcts <- makeAnnualPI(dailyBoot, eList)
head(annualPcts[["flux"]])
#>    DecYear       p1     p2.5       p5      p10      p25      p50      p75
#> 1 1980.249 300.2398 300.2398 301.8455 307.1477 309.4482 317.7999 330.2232
#> 2 1981.249 153.7898 153.7898 153.9703 158.7941 164.4680 168.8981 175.3665
#> 3 1982.249 262.1990 262.1990 263.3815 268.0285 274.5739 288.0483 296.1632
#> 4 1983.249 323.4122 323.4122 324.8703 332.7810 351.4329 360.9021 369.6140
#> 5 1984.249 387.9003 387.9003 396.3133 417.9942 426.2565 434.0034 446.7875
#> 6 1985.249 120.6924 120.6924 120.9460 122.3459 123.9973 126.8312 131.8363
#>        p90      p95    p97.5      p99
#> 1 347.9412 353.3627 354.7580 354.7580
#> 2 179.5756 181.7312 182.0641 182.0641
#> 3 304.9160 307.9942 308.3691 308.3691
#> 4 385.3095 393.8460 394.9293 394.9293
#> 5 458.4162 461.3039 461.9950 461.9950
#> 6 136.5073 139.2032 139.6815 139.6815
head(annualPcts[["conc"]])
#>    DecYear        p1      p2.5        p5       p10       p25       p50
#> 1 1980.249 0.8943015 0.8943015 0.9002018 0.9160820 0.9359561 0.9669431
#> 2 1981.249 0.9118777 0.9118777 0.9142081 0.9255707 0.9462244 0.9693073
#> 3 1982.249 1.0132666 1.0132666 1.0154235 1.0225617 1.0430828 1.0774149
#> 4 1983.249 0.9298767 0.9298767 0.9345345 0.9510482 0.9844741 1.0125638
#> 5 1984.249 0.9474285 0.9474285 0.9475826 0.9493554 0.9627001 0.9869344
#> 6 1985.249 0.9712238 0.9712238 0.9737614 0.9810472 0.9995361 1.0212897
#>         p75      p90      p95    p97.5      p99
#> 1 0.9980734 1.048386 1.075781 1.085602 1.085602
#> 2 1.0075477 1.028927 1.041497 1.042789 1.042789
#> 3 1.1230733 1.138615 1.142896 1.143837 1.143837
#> 4 1.0489304 1.081274 1.083430 1.083898 1.083898
#> 5 1.0215825 1.039515 1.042340 1.043366 1.043366
#> 6 1.0640089 1.101643 1.115537 1.120401 1.120401