Computes \(P(X > val)\) where \(X = w_1 Y + w_2 Z\), where \(Y\) is chi square distributed with \(d_1\) degrees of freedom, \(Z\) is chi square distributed with \(d_2\) degrees of freedom, and \(w_1\) and \(w_2\) are weights with \(w_2\) assumed positive. The probability is computed using numerical integration of the densities of the two chi square distributions. (Method: trapezoidal rule)

weightedChi2P(val, w1, w2, d1, d2)

Arguments

val

observed statistic

w1

weight of first chi square rv

w2

weight of second chi square rv, assumed positive

d1

degrees of freedom of first chi square rv

d2

degrees of freedom of second chi square rv

Value

1 - CDF = P(X > val)

Details

This is used in the large \(P\) asymptotics of the permutation test.

Dependencies: None