New methods to compute the generalized chi-square distribution
Abhranil Das
TL;DR
This work tackles the challenge of computing the generalized chi-square distribution in all tail regimes by introducing two exact (ray-tracing and inverse Fourier) and two approximate (ellipse and infinite-tail) methods, complemented by open-source Matlab software. It builds a canonical mapping from generalized chi-square parameters to a standard-normal quadratic form, enabling flexible sampling and multiple computational strategies. The authors provide comprehensive accuracy and speed comparisons against established methods (Ruben, Imhof), derive tail-specific asymptotics, and validate performance with random parameter draws and discriminability measurements between equal-covariance multinormals. The framework delivers robust tail probabilities down to extreme levels (down to $10^{-10^{308}}$ in double precision via log-variance techniques) and offers practical guidance on selecting the best method for a given tail regime, thereby improving reliability in statistics, ML, and physics applications that rely on generalized quadratic forms.
Abstract
We present four new mathematical methods, two exact and two approximate, along with open-source software, to compute the cdf, pdf and inverse cdf of the generalized chi-square distribution. Some methods are geared for speed, while others are designed to be accurate far into the tails, using which we can also measure large values of the discriminability index $d'$ between multivariate normal distributions. We compare the accuracy and speed of these and previous methods, characterize their advantages and limitations, and identify the best methods to use in different cases.
