Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

MGBT (version 1.0.4)

CondMomsChi2: Conditional Moments: N.B. Moments employ only observations above Xsi

Description

Compute the χ2-conditional moments (Chi-squared distributed moments) based on only those (n r) observations above a threshold Xsi for a sample size of n and r number of truncated observations. The first moment is (gtmoms(xsi,2) - gtmoms(xsi,1)^2) that is in the first returned column. The second moment (variance of S-squared) is V(n,r,pnorm(xsi))[2,2] that is in the second returned column. Further mathematical details are available under functions gtmoms and V.

Usage

CondMomsChi2(n, r, xsi)

Arguments

n

The number of observations;

r

The number of truncated observations; and

xsi

The lower threshold (see gtmoms).

Value

The value a two-column, one-row R matrix.

References

Cohn, T.A., 2013--2016, Personal communication of original R source code: U.S. Geological Survey, Reston, Va.

See Also

CondMomsZ, gtmoms

Examples

Run this code
# NOT RUN {
CondMomsChi2(58, 2, -3.561143)
#          [,1]       [,2]
#[1,] 0.9974947 0.03574786

# Note that CondMomsChi2(58, 2, -3.561143)[2] == V(58, 2, pnorm(-3.561143))[2,2]
# }

Run the code above in your browser using DataLab