Skip to contents

This function takes the output from genDailyBoot and calculates the quantiles for a daily aggregation.

Usage

makeDailyPI(dailyBootOut, eList, 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.

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 Date. 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
# \donttest{
dailyPcts <- makeDailyPI(dailyBoot, eList)
head(dailyPcts[["flux"]])
#>         Date  DecYear        p1      p2.5       p5      p10      p25      p50
#> 1 1979-10-01 1979.750 108.85328 108.85328 110.7387 117.4744 128.0440 136.3389
#> 2 1979-10-02 1979.753  99.24955  99.24955 104.9431 119.9514 128.1189 143.2019
#> 3 1979-10-03 1979.755 122.53540 122.53540 124.0501 131.8080 149.0372 166.6936
#> 4 1979-10-04 1979.758 155.71447 155.71447 157.5686 163.1568 178.8756 203.0882
#> 5 1979-10-05 1979.761 150.59668 150.59668 150.6070 160.7641 195.2427 210.0535
#> 6 1979-10-06 1979.764 121.47619 121.47619 126.5504 141.3553 170.2329 182.8105
#>        p75      p90      p95    p97.5      p99
#> 1 146.1200 155.5465 157.3203 157.9757 157.9757
#> 2 150.6974 163.4249 168.5032 168.9131 168.9131
#> 3 194.4266 205.3892 213.5120 216.5846 216.5846
#> 4 222.5818 236.7537 248.6268 252.6469 252.6469
#> 5 246.5143 268.4792 270.6394 270.7597 270.7597
#> 6 212.2932 231.9834 261.7761 272.9430 272.9430
head(dailyPcts[["conc"]])
#>         Date  DecYear        p1      p2.5        p5       p10       p25
#> 1 1979-10-01 1979.750 0.6640612 0.6640612 0.6755632 0.7166547 0.7811343
#> 2 1979-10-02 1979.753 0.5713623 0.5713623 0.6041392 0.6905393 0.7375578
#> 3 1979-10-03 1979.755 0.5163346 0.5163346 0.5227170 0.5554072 0.6280067
#> 4 1979-10-04 1979.758 0.4679845 0.4679845 0.4735570 0.4903516 0.5375929
#> 5 1979-10-05 1979.761 0.4274588 0.4274588 0.4274880 0.4563184 0.5541836
#> 6 1979-10-06 1979.764 0.4393940 0.4393940 0.4577480 0.5112991 0.6157527
#>         p50       p75       p90       p95     p97.5       p99
#> 1 0.8317377 0.8914077 0.9489137 0.9597352 0.9637333 0.9637333
#> 2 0.8243882 0.8675388 0.9408086 0.9700432 0.9724031 0.9724031
#> 3 0.7024065 0.8192667 0.8654604 0.8996881 0.9126353 0.9126353
#> 4 0.6103617 0.6689477 0.7115400 0.7472232 0.7593053 0.7593053
#> 5 0.5962231 0.6997147 0.7620608 0.7681922 0.7685336 0.7685336
#> 6 0.6612476 0.7678900 0.8391119 0.9468756 0.9872676 0.9872676
# }