harmonic.mean | R Documentation |
Compute the harmonic mean of a vector with a zero-value correction.
\check{\mu} =
\biggl(\frac{\sum^{N_T - N_0}_{i=1} 1/x_i}
{N_T - N_0}\biggr)^{-1} \times \frac{N_T - N_0}
{N_T} \mbox{,}
where \check{\mu}
is harmonic mean, x_i
is a nonzero value of the data vector, N_T
is the (total) sample size, N_0
is the number of zero values.
harmonic.mean(x)
x |
A vector of data values that will be reduced to non-missing values. |
An R list
is returned.
harmean |
The harmonic mean with zero-value correction, |
correction |
The zero-value correction, |
source |
An attribute identifying the computational source of the harmonic mean: “harmonic.mean”. |
The harmonic mean can not be computed when zero values are present. This situation is common in surface-water hydrology. As stated in the reference below, in order to calculate water-quality-based effluent limits (WQBELs) for human health protection, a harmonic mean flow is determined for all perennial streams and for streams that are intermittent with perennial pools. Sometimes these streams have days on which measured flow is zero. Because a zero flow cannot be used in the calculation of harmonic mean flow, the second term in the harmonic mean equation is an adjustment factor used to lower the harmonic mean to compensate for days on which the flow was zero. The zero-value correction is the same correction used by the EPA computer program DFLOW.
W.H. Asquith
Texas Commission on Environmental Quality, 2003, Procedures to implement the Texas surface-water-quality standards: TCEQ RG–194, p. 47
pmoms
Q <- c(0,0,5,6,7)
harmonic.mean(Q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.