akq_counts: Count Table from the Asquith-Knight Discharge Decay Analyses

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Extract the count table (counts) from Asquith–Knight discharge decay analyses. The count table is an R data.frame has been already made by akqdecay for a sequence of USGS streamgage identification numbers contained within an R environment. This environment has already been populated by fill_akqenv. The various counts of direction of change in the daily-mean streamflows are computed (decreasing, increasing, or no change) in akqdecay regardless of the arguments decreasing and lag originally passed to that function.

Usage

1
akq_counts(akqenv, silent=FALSE, ...)

Arguments

akqenv

The R environment previously populated by fill_akqenv. This argument can also be a direct R list from akqdecay; special accommodation is made;

silent

Suppress informative calls to message(); and

...

Additional arguments to pass (see source code to ascertain flexible usage).

Value

An R data.frame containing the counts for each streamgage.

site

The streamgage identification number;

total_count

The total number of daily-mean streamflow values;

decreases

The number of decreases (\checkΨ);

increases

The number of increases (\hatΨ);

nochanges

The number of no changes (\ddotΨ);

NAs

The number of missing values. Total count is the sum of the decreases, increases, no changes, and number of NAs. The NAs can results from gaps in record, zero flow in the data, and transitions from flow to no flow or no flow back to flow;

rawDV_zeros

This is a counter on the number of zero values before the differencing (the original data), hence the term raw. This value is provided to help a user in interpretation of the NAs;

rawDV_NAs

This is a counter on the number of NA values before the differencing (the original data), hence the term raw. This value is provided to help a user in interpretation of the NAs; and

delDates_ne_lag

This is a “delta (change) between dates not equal to the lag” counter. Such a counter tracks the number of changes between successive dates that are not equal to the lag and thus represent data values not involved in statistical computation.

Note

What does delta (change) between dates not equal to the lag mean? Gaps in record should result in a missing value for the “tomorrow” date (note the use of the subscripts for date in the text that follows as presenting the tomorrow [forward bias notation]). For example, a transition from \mathrm{Jan1} (January 1st) to \mathrm{Jan2} would have a Δ\mathrm{Date}_\mathrm{Jan2} = 1, but a transition from \mathrm{Jan2} to \mathrm{Jan4} because \mathrm{Jan3} is not available (say the streamgage was not operational or perhaps record flagged as provisional and that record was ignored) would have a Δ\mathrm{Date}_\mathrm{Jan4} = 2. If the lag=1, then only the former and not the later enter into statistical computation.

Visualization of count distributions? Here is a recipe for visualizing the quantile distribution of the total number of Ψ available in akqenv:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  CN <- akq_counts(akqenv)
  ylim <- range(CN$total_count, CN$nochanges, CN$increases, CN$decreases)
  ylim[1] <- ifelse(ylim[1] == 0, 1, ylim[1])
  plot(qnorm(lmomco::pp(CN$total_count)),sort(CN$total_count),log="y",lwd=0.8,
       xlab="Standard Normal Variate", ylab="Number of Differences")
  points(qnorm(lmomco::pp(CN$nochanges)), sort(CN$nochanges),  col=3, lwd=0.8)
  points(qnorm(lmomco::pp(CN$increases)), sort(CN$increases),  col=4, lwd=0.8)
  points(qnorm(lmomco::pp(CN$decreases)), sort(CN$decreases),  col=2, lwd=0.8)
  legend(0,100, c("total_count", "nochanges", "increases", "decreases"),
                col=c(1,3,4,2), pch=c(1,1,1,1), bty="n")

Author(s)

W.H. Asquith

See Also

akqdecay, fill_akqenv, akq_lmom, akq_summary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sites <- c("05403500", "05405000") # Two USGS streamgages in Wisconsin
WisExample <- new.env(); fill_dvenv( sites,              envir=WisExample,
                                     sdate="1945-01-01", edate="2014-12-31")
WisAKQ <- new.env(); fill_akqenv(dvenv=WisExample, envir=WisAKQ)
akq_counts(WisAKQ) # hand editing for line wrapping made below
#    site total_count decreases increases nochanges NAs
#05403500       17714      8829      6023      2852   9
#05405000       25566     13293      9415      2858   0
#    site rawDV_zeros rawDV_NAs delDates_ne_lag
#05403500           0         0               9
#05405000           0         0               0 #

wasquith-usgs/akqdecay documentation built on Nov. 9, 2020, 1:13 p.m.