Skip to contents

This function uses weighted survival regression to estimate three surfaces that cover the complete range of DecYear and log(Q) values in the Daily data set. These surfaces are: (1) is the estimated log concentration (yHat), (2) is the estimated standard error (SE), (3) is the estimated concentration (ConcHat). They are mapped as an array that covers the complete space of daily discharge and time. The first index is discharge, layed out in 14 equally spaced levels of log(Q). The second index is time, layed out as 16 increments of the calendar year, starting January 1. It returns the 3 dimensional array called surfaces. This array will be used to estimate these 3 quantities for any given day in the daily values record.

Usage

estSurfaces(eList, surfaceStart = NA, surfaceEnd = NA, localSample = NA,
  windowY = 7, windowQ = 2, windowS = 0.5, minNumObs = 100,
  minNumUncen = 50, edgeAdjust = TRUE, verbose = TRUE,
  interactive = NULL, run.parallel = FALSE)

Arguments

eList

named list with at least the Sample and Daily dataframes

surfaceStart

Date object for start of surface slice (or character starting date for data retrieval in the form YYYY-MM-DD). Default is NA .

surfaceEnd

Date object for end of surface slice (or character starting date for data retrieval in the form YYYY-MM-DD). Default is NA .

localSample

data frame to override eList$Sample. Default is NA .

windowY

numeric specifying the half-window width in the time dimension, in units of years, default is 7

windowQ

numeric specifying the half-window width in the discharge dimension, units are natural log units, default is 2

windowS

numeric specifying the half-window with in the seasonal dimension, in units of years, default is 0.5

minNumObs

numeric specifying the miniumum number of observations required to run the weighted regression, default is 100

minNumUncen

numeric specifying the minimum number of uncensored observations to run the weighted regression, default is 50

edgeAdjust

logical specifying whether to use the modified method for calculating the windows at the edge of the record. Default is TRUE.

verbose

logical specifying whether or not to display progress message

interactive

logical deprecated. Use 'verbose' instead

run.parallel

logical to run bootstrapping in parallel or not

Value

surfaces array containing the three surfaces estimated, array is 3 dimensional

Examples

eList <- Choptank_eList
# \donttest{
surfaces <- estSurfaces(eList)
#> Survival regression (% complete):
#> 0 	1 	2 	3 	4 	5 	6 	7 	8 	9 	10 	
#> 11 	12 	13 	14 	15 	16 	17 	18 	19 	20 	
#> 21 	22 	23 	24 	25 	26 	27 	28 	29 	30 	
#> 31 	32 	33 	34 	35 	36 	37 	38 	39 	40 	
#> 41 	42 	43 	44 	45 	46 	47 	48 	49 	50 	
#> 51 	52 	53 	54 	55 	56 	57 	58 	59 	60 	
#> 61 	62 	63 	64 	65 	66 	67 	68 	69 	70 	
#> 71 	72 	73 	74 	75 	76 	77 	78 	79 	80 	
#> 81 	82 	83 	84 	85 	86 	87 	88 	89 	90 	
#> 91 	92 	93 	94 	95 	96 	97 	98 	99 	
#> Survival regression: Done

surfaceStart <- "1984-10-01"
surfaceEnd <- "1986-09-30"
surfaces_1 <- estSurfaces(eList, surfaceStart, surfaceEnd)
#> Survival regression (% complete):
#> 0 	1 	2 	3 	4 	5 	6 	7 	8 	9 	10 	
#> 11 	12 	13 	14 	15 	16 	17 	18 	19 	20 	
#> 21 	22 	23 	24 	25 	26 	27 	28 	29 	30 	
#> 31 	32 	33 	34 	35 	36 	37 	38 	39 	40 	
#> 41 	42 	43 	44 	45 	46 	47 	48 	49 	50 	
#> 51 	52 	53 	54 	55 	56 	57 	58 	59 	60 	
#> 61 	62 	63 	64 	65 	66 	67 	68 	69 	70 	
#> 71 	72 	73 	74 	75 	76 	77 	78 	79 	80 	
#> 81 	82 	83 	84 	85 	86 	87 	88 	89 	90 	
#> 91 	92 	93 	94 	95 	96 	97 	98 	99 	
#> Survival regression: Done

wall_sample <- head(eList$Sample, n=500)

surface_wall <- estSurfaces(eList, localSample = wall_sample)
#> Survival regression (% complete):
#> 0 	1 	2 	3 	4 	5 	6 	7 	8 	9 	10 	
#> 11 	12 	13 	14 	15 	16 	17 	18 	19 	20 	
#> 21 	22 	23 	24 	25 	26 	27 	28 	29 	30 	
#> 31 	32 	33 	34 	35 	36 	37 	38 	39 	40 	
#> 41 	42 	43 	44 	45 	46 	47 	48 	49 	50 	
#> 51 	52 	53 	54 	55 	56 	57 	58 	59 	60 	
#> 61 	62 	63 	64 	65 	66 	67 	68 	69 	70 	
#> 71 	72 	73 	74 	75 	76 	77 	78 	79 	80 	
#> 81 	82 	83 	84 	85 	86 	87 	88 	89 	90 	
#> 91 	92 	93 	94 	95 	96 	97 	98 	99 	
#> Survival regression: Done

# }