Skip to contents

This function uses an autoregressive model to produce more accurate estimates of concentration and flux

Usage

WRTDSKalman(eList, rho = 0.9, niter = 200, seed = NA, verbose = TRUE)

Arguments

eList

named list with the INFO, Daily, and Sample dataframes and surfaces matrix

rho

numeric the lag one autocorrelation. Default is 0.9.

niter

number of iterations. Default is 200.

seed

integer value. Defaults to NA, which will not change the current seed. Setting the seed to any given value can be used to create repeatable output.

verbose

logical specifying whether or not to display progress message

Details

This function takes an existing eList Including the estimated model (the surfaces object in the eList) And produces the daily WRTDSKalman estimates of concentration and flux These generated estimates are called genConc and genFlux

Examples

eList <- Choptank_eList
eList <- WRTDSKalman(eList, niter = 10)
#> % complete:
#> 10 	
#> 20 	
#> 30 	
#> 40 	
#> 50 	
#> 60 	
#> 70 	
#> 80 	
#> 90 	
#> 100 	
summary(eList$Daily)
#>       Date                  Q                 Julian          Month       
#>  Min.   :1979-10-01   Min.   :  0.00991   Min.   :47389   Min.   : 1.000  
#>  1st Qu.:1987-09-30   1st Qu.:  0.93446   1st Qu.:50311   1st Qu.: 4.000  
#>  Median :1995-09-30   Median :  2.40693   Median :53232   Median : 7.000  
#>  Mean   :1995-09-30   Mean   :  4.08658   Mean   :53232   Mean   : 6.523  
#>  3rd Qu.:2003-09-30   3rd Qu.:  4.61565   3rd Qu.:56154   3rd Qu.:10.000  
#>  Max.   :2011-09-30   Max.   :246.35656   Max.   :59076   Max.   :12.000  
#>                                                                           
#>       Day           DecYear        MonthSeq     Qualifier        
#>  Min.   :  1.0   Min.   :1980   Min.   :1558   Length:11688      
#>  1st Qu.: 93.0   1st Qu.:1988   1st Qu.:1654   Class :character  
#>  Median :184.0   Median :1996   Median :1750   Mode  :character  
#>  Mean   :183.8   Mean   :1996   Mean   :1749                     
#>  3rd Qu.:275.0   3rd Qu.:2004   3rd Qu.:1845                     
#>  Max.   :366.0   Max.   :2012   Max.   :1941                     
#>                                                                  
#>        i              LogQ                Q7                Q30          
#>  Min.   :    1   Min.   :-4.61412   Min.   : 0.01808   Min.   : 0.09606  
#>  1st Qu.: 2923   1st Qu.:-0.06779   1st Qu.: 0.98704   1st Qu.: 1.16949  
#>  Median : 5844   Median : 0.87835   Median : 2.55661   Median : 2.86850  
#>  Mean   : 5844   Mean   : 0.76616   Mean   : 4.08569   Mean   : 4.08160  
#>  3rd Qu.: 8766   3rd Qu.: 1.52945   3rd Qu.: 4.93017   3rd Qu.: 5.69169  
#>  Max.   :11688   Max.   : 5.50678   Max.   :84.00395   Max.   :25.47478  
#>                                     NA's   :6          NA's   :29        
#>       yHat                 SE            ConcDay          FluxDay        
#>  Min.   :-1.790952   Min.   :0.1347   Min.   :0.1776   Min.   :   1.643  
#>  1st Qu.:-0.004236   1st Qu.:0.2191   1st Qu.:1.0357   1st Qu.:  98.013  
#>  Median : 0.130934   Median :0.2504   Median :1.1959   Median : 250.088  
#>  Mean   : 0.120318   Mean   :0.2689   Mean   :1.1978   Mean   : 366.085  
#>  3rd Qu.: 0.258944   3rd Qu.:0.3029   3rd Qu.:1.3551   3rd Qu.: 484.360  
#>  Max.   : 0.661543   Max.   :0.6146   Max.   :1.9666   Max.   :5519.450  
#>                                                                          
#>      FNConc           FNFlux          GenFlux            GenConc       
#>  Min.   :0.8352   Min.   : 77.55   Min.   :    1.60   Min.   :0.04955  
#>  1st Qu.:1.0540   1st Qu.:169.71   1st Qu.:   96.98   1st Qu.:1.00000  
#>  Median :1.2067   Median :318.61   Median :  247.37   Median :1.20000  
#>  Mean   :1.2004   Mean   :362.71   Mean   :  377.36   Mean   :1.21672  
#>  3rd Qu.:1.3314   3rd Qu.:538.44   3rd Qu.:  498.45   3rd Qu.:1.41998  
#>  Max.   :1.6882   Max.   :943.75   Max.   :11927.06   Max.   :2.43000  
#>                                                                        

#All flux values in AnnualResults are expressed as a rate in kg/day
AnnualResults <- setupYears(eList$Daily)
head(AnnualResults)
#>    DecYear        Q      Conc     Flux    FNConc   FNFlux   GenConc  GenFlux
#> 1 1980.249 4.251937 0.9485403 316.0491 1.0027237 291.2176 0.9664242 318.3866
#> 2 1981.249 2.217248 1.0351962 184.6712 0.9988918 296.7260 0.9978313 173.3971
#> 3 1982.249 3.046039 1.0361327 269.6309 0.9931881 300.7424 1.0940643 290.2776
#> 4 1983.249 4.986713 1.0072716 363.8563 0.9931768 305.5898 1.0306304 365.9152
#> 5 1984.249 5.718146 0.9901927 437.3007 1.0017255 312.2260 1.0279141 456.6785
#> 6 1985.249 1.517457 1.0571854 133.9210 1.0165324 318.5007 1.0402486 129.2930
#>   PeriodLong PeriodStart
#> 1         12          10
#> 2         12          10
#> 3         12          10
#> 4         12          10
#> 5         12          10
#> 6         12          10