peta {MGBT} | R Documentation |
Probability of Eta
Description
Compute peta
, which is the survival probability of the t-distribution for eta =
.
Define as the inverse (quantile) of the Beta distribution for nonexceedance probability
having two shape parameters (
and
) as
for sample size and number of truncated observations
and note that
. Next, define
as the
-score for
where is the inverse of the standard normal distribution.
Compute the covariance matrix of
and
from
VMS
as in COV = VMS(n, r, qmin=br)
, and from which define
which is a covariance divided by a variance, and then define
Compute the expected values of and
from
EMS
as in
EMp = EMS(n, r, qmin=br)
, and from which define
Compute the conditional moments from CondMomsChi2
as in
CondMomsChi2(n,r,zr)
, and from which define
Usage
peta(pzr, n, r, eta)
Arguments
pzr |
The probability level of a Beta distribution having shape1 |
n |
The number of observations; |
r |
The number of truncated observations; and |
eta |
The Grubbs–Beck statistic ( |
Details
Currently (2019), context is lost on the preformatted note of code note below. It seems possible that the intent by WHA was to leave a trail for future revisitation of the Beta distribution and its access, which exists in native R code.
zr <- qnorm(qbeta(the.pzr, shape1=r, shape2=n+1-r)) CV <- VMS(n, r, qmin=pnorm(zr))
Value
The probability of the eta
value.
Note
Testing a very large streamgage dataset in Texas with GRH, shows at least one failure of the following computation was encountered for a short record streamgage numbered 08102900.
# USGS 08102900 (data sorted, 1967--1974) #https://nwis.waterdata.usgs.gov/nwis/peak?site_no=08102900&format=hn2 Peaks <- c(40, 45, 53, 55, 88) # in cubic feet per second (cfs) MGBT(Peaks) # Here is the line in peta(): SigmaMp <- sqrt(CV[1,1] - CV[1,2]^2/CV[2,2]) # *** In sqrt(CV[1, 1] - CV[1, 2]^2/CV[2, 2]) : NaNs produced
In implementation, a suppressWarnings()
is wrapped on the SigmaMp
. If the authors make no action in response to NaN
, then the low-outlier threshold is 53 cubic feet per second (cfs) with a p-value for 40 cfs as 0.81 and 45 cfs as 0.0. This does not seem logical. The is.finite
catch in the next line (see sources) is provisional under a naïve assumption that the negative in the square root has barely undershot. The function is immediately exited with the returned p-value set to unity. Testing indicates that this is a favorable innate trap here within the MGBT package and will avoid higher up error trapping in larger application development.
Author(s)
W.H. Asquith consulting T.A. Cohn source
Source
LowOutliers_jfe(R).txt
, LowOutliers_wha(R).txt
, P3_089(R).txt
—Named peta
References
Cohn, T.A., 2013–2016, Personal communication of original R source code: U.S. Geological Survey, Reston, Va.
See Also
EMS
, VMS
, CondMomsChi2
, gtmoms
Examples
peta(0.4, 58, 2, -2.3006)
#[1] 0.298834