towercountsummary: Tower Count Summary

Description Usage Arguments Value Author(s) Examples

View source: R/towercountsummary.R

Description

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

Usage

1
2
3
towercountsummary(date, hour, count, clarity, maxclarity = 4,
  hourfrac = 1/6, interpwithin = T, interpbetween = T,
  hourproprows = NULL, abscounts4props = T)

Arguments

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.

Value

A countsummary object, with elements

Author(s)

Matt Tyers

Examples

1
2
3
4
5
6
data(Gulk_2015)

chin2015 <- towercountsummary(date=Gulk_2015$date, hour=Gulk_2015$hour,
     count=Gulk_2015$chin, clarity=Gulk_2015$clarity)

str(chin2015)

mbtyers/towercount documentation built on Dec. 21, 2021, 3:56 p.m.