Description Usage Arguments Value Author(s) Examples
View source: R/towercountsummary.R
Reads raw tower count data and computes the abundance estimate and standard error, incorporating all specified interpolations.
Count days are considered as beginning at 16:00 and ending at 15:59, with counts occurring between 16:00 and 23:59 on a given calendar date treated as occurring on the following count day.
Hourly run proportions are calculated by summing the absolute counts (or counts) across days for each hour block, and dividing by the total of absolute counts (or counts.) Summation is performed for days in which no hourly count is missed, unless otherwise specified.
If all counts were represented during a count day (having values of clarity
recorded as less than or equal to maxclarity
), daily escapement is
estimated as
N_d = (M_d/m_d)*sum(y_dj) for j=1,...,m_d
in which the subscript d denotes day, M_d is the total number of possible paired 10-minute counting periods in day d, m_d is the number of sampled 10-minute counting periods in day d, and y_dj is the observed count for period j within day d.
Variance of the daily total is estimated as
V(N_d) = (1-m_d/M_d)*(M_d^2)*(s_d^2)/m_d
in which
s_d^2 = 1/(2*(m_d-1)) * sum((y_dj - y_d(j-1))^2) for j=2,...,m_d
If some counts are missing due to water quality, but more than 25 percent of the expected daily run (calculated using the hourly run proportions, expressing the diel migratory pattern) and 25 percent or more of the peak run periods are represented in the daily count, the quantity
y_dc,interp = y_dc*(1-p_edp)/p_edp
is added to the daily count, in which y_dc denotes daily count, and p_edp represents the proportion of the expected daily escapement successfully counted. If this quantity is greater than zero, the difference is allocated to the hourly counts such that the hourly proportions are consistent with the diel migratory pattern. If observed hourly counts are greater than interpolated hourly values, observed counts are retained.
In these cases, the variance of the expanded daily escapement is calculated as given above, but with m_d calculated as
m_d = m_d,observed*p_edp
This inflates the resulting variance according to the diminished effective daily sample size.
If daily counts represent less than 25 percent of the expected daily escapement or if less than 25 percent of the peak run periods are represented in the daily count, daily totals are interpolated according to the form
N_i = sum(I(day j was sampled)*N_j)/sum(I(day j was sampled)) for j=(i-k),...,(i+k)
in which k = the number of days missed due to adverse viewing conditions. The variance of the daily total is estimated as the maximum daily variance of the days used for interpolation.
The total estimated escapement and associated variance are then calculated according to the sums
N = sum(N_d) for d = all possible days
V(N) = sum(V(N_d)) for d = all possible days
1 2 3 | towercountsummary(date, hour, count, clarity, maxclarity = 4,
hourfrac = 1/6, interpwithin = T, interpbetween = T,
hourproprows = NULL, abscounts4props = T)
|
date |
A vector of dates. This can be in numeric or date format. |
hour |
A vector of hour blocks corresponding to counts. Values must be numeric, between 0 and 23. |
count |
A vector of counts. |
clarity |
A vector of clarity values of water clarity, defined as 1: Excellent / 2: Good / 3: Fair / 4: Poor / 4.5: Very poor / 5: Unobservable |
maxclarity |
The largest value (poorest visibility) of clarity that will be accepted as a count, without interpolating. Defaults to 4. |
hourfrac |
The proportion of each hour block that counts were conducted. Defaults to 1/6. |
interpwithin |
Whether to interpolate hourly counts with poor clarity within an otherwise good-clarity count day. Specifying TRUE imputes interpolated hourly counts, and specifying FALSE accepts the recorded counts. In both cases, the bad-visibility counts are treated as no-counts in the variance calculation. Defaults to TRUE. |
interpbetween |
Whether to interpolate daily counts in which less than 25 percent of the estimated daily run is recorded due to poor visibility. Specifying TRUE imputes interpolated daily counts, and specifying FALSE accepts the recorded counts. Defaults to TRUE. |
hourproprows |
A vector of count-day rows to use for calculating hourly run proportions. If the default (NULL) is accepted, all rows not missing hourly counts will be used. |
abscounts4props |
Whether to use absolute counts for calculating hourly run proportions (TRUE) or treat negative counts (fish running down-river) as negative in the summation (FALSE). Defaults to TRUE. |
A countsummary object, with elements
$maxclarity
: The largest value of clarity that was accepted
as a count
$countmatrix
: The matrix of hourly counts that
was used for escapement and variance calculations, including any
interpolations
$rawcountmatrix
: The matrix of observed
hourly counts
$claritymatrix
: The matrix of clarity values,
corresponding to the counts in $countmatrix
and
$rawcountmatrix
$propbyhour
: A numeric vector of
hourly run proportions, defined as the proportion for hours 16 through 15
$calcmatrix
: The matrix of calculations leading up to the
variance calculation (returned as a data frame)
$Nhat
: The
total escapement estimate
$Varhat
: The variance of the total
escapement estimate
$SE
: The standard error of the total
escapement estimate
$CI
: An approximate Wald-type 95 percent
confidence interval for the total escapement
$maxpass
: A
two-element vector, defined as the first and last hours of the period of
peak passage. This is calculated as the hours corresponding to the minimum
time interval representing greater than 80 percent of the overall run. If
multiple intervals of the same length had greater than 80 percent of the
total run, the median interval was selected.
$totcount
: The
total net escapement visually counted.
Matt Tyers
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.