peta: Probability of Eta

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

Description

Compute peta, which is the survival probability of the t-distribution for eta = η.

Define b_r as the inverse (quantile) of the Beta distribution for nonexceedance probability F \in (0,1) having two shape parameters (α and β) as

b_r = \mathrm{Beta}^{(-1)}(F; α, β) = \mathrm{Beta}^{(-1)}(F; r, n+1-r)\mbox{,}

for sample size n and number of truncated observations r and note that b_r \in (0,1). Next, define z_r as the Z-score for b_r

z_r = Φ^{(-1)}(b_r)\mbox{,}

where Φ^{(-1)}(\cdots) is the inverse of the standard normal distribution.

Compute the covariance matrix COV of M and S from VMS as in COV = VMS(n, r, qmin=br), and from which define

λ = COV_{1,2} / COV_{2,2}\mbox{,}

which is a covariance divided by a variance, and then define

η_p = λ + η\mbox{.}

Compute the expected values of M and S from EMS as in EMp = EMp = EMS(n, r, qmin=br), and from which define

μ_{Mp} = EMp_1 - λ\times EMp_2\mbox{,}

σ_{Mp} = √{COV_{1,1} - COV_{1,2}^2/COV_{2,2}}\mbox{.}

Compute the conditional moments from CondMomsChi2 as in momS2 = CondMomsChi2(n,r,zr), and from which define

df = 2 momS2_1^2 / momS2_2\mbox{,}

α = momS2_2 / momS2_1\mbox{,}

Usage

1
peta(pzr, n, r, eta)

Arguments

pzr

The probability level of a Beta distribution having shape1 α = r and shape2 β = n+1-r;

n

The number of observations;

r

The number of truncated observations; and

eta

The Grubbs–Beck statistic (GB_r, see MGBT).

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.

1
2
      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.

1
2
3
4
5
6
  # 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

1
2
peta(0.4, 58, 2, -2.3006)
#[1] 0.298834

wasquith-usgs/MGBT documentation built on Aug. 6, 2019, 4:57 p.m.