Compute peta
, which is the survival probability of the t-distribution for eta =
\(\eta\).
Define \(b_r\) as the inverse (quantile) of the Beta distribution for nonexceedance probability \(F \in (0,1)\) having two shape parameters (\(\alpha\) and \(\beta\)) as $$b_r = \mathrm{Beta}^{(-1)}(F; \alpha, \beta) = \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 = \Phi^{(-1)}(b_r)\mbox{,}$$ where \(\Phi^{(-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
$$\lambda = COV_{1,2} / COV_{2,2}\mbox{,}$$
which is a covariance divided by a variance, and then define
$$\eta_p = \lambda + \eta\mbox{.}$$
Compute the expected values of \(M\) and \(S\) from EMS
as in \(EMp = \) EMp = EMS(n, r, qmin=br)
, and from which define
$$\mu_{Mp} = EMp_1 - \lambda\times EMp_2\mbox{,}$$
$$\sigma_{Mp} = \sqrt{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{,}$$
$$\alpha = momS2_2 / momS2_1\mbox{,}$$
peta(pzr, n, r, eta)
The probability level of a Beta distribution having shape1 \(\alpha = r\) and shape2 \(\beta = n+1-r\);
The number of observations;
The number of truncated observations; and
The Grubbs--Beck statistic (\(GB_r\), see MGBT
).
The probability of the eta
value.
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))
Cohn, T.A., 2013--2016, Personal communication of original R source code: U.S. Geological Survey, Reston, Va.
EMS
, VMS
, CondMomsChi2
, gtmoms
# NOT RUN {
peta(0.4, 58, 2, -2.3006)
#[1] 0.298834
# }
Run the code above in your browser using DataLab