Maybe Not Completely Redundant Message #7 Posted by Les Wright on 5 Dec 2011, 8:47 a.m., in response to message #2 by Paul Dale
Actually, the wp34s provides only the lower regularized incomplete gamma and cdf's (lower -tail) for phi and chi-square.
But what if one wants high precision in the upper tail of the regularized incomplete gamma or its specific relatives? For phi it's easy, since the symmetry of the standard normal distribution means that 1 - phi(x) = phi(-x), so if I want the upper-tail probability associated with the normal statistic x = 3 I would compute phi(-3) instead.
But there is no such reflection relation for chi-square. A high-value of the statistic will give a probability close to one, and digits (and precision) will be lost due to subtraction from 1 to get the complementary upper-tail probability. It is probably better to compute the upper-tail chi-square probability by way of the underlying continued fraction expansion for the right-sided incomplete gamma--IGL in my program. Of course, this only matters if one really cares about the lost digits. In practical applications, most likely wouldn't.
I notice the built-in erfc function gives all or almost all 16 digits accurate for higher values of the argument in cases where subtracting erf from 1 would give zero. I am surmising that erfc has it's own routine and is not derived from the built-in regularized incomplete gamma.
|