Polynomial approximation of $\chi^2$ distribution pdf

453 Views Asked by At

The $\chi^2$ distribution PDF is $$f_{\chi^2}(x;k) = \frac{1}{2^{k/2}\Gamma(k/2)} x^{k/2 - 1} \mathrm{e}^{-x/2} \mathbf{1}_{x \geq 0}$$

I am trying to find a polynomial approximation to this density function. Power series expansion for the exponential $\mathrm{e}^x$ works fine, but it's an infinite series. I an looking at possibilities to attain a more compact approximation. Approximation using orthogonal polynomials is one option I'm looking at.

Are there better alternatives to power series expansion of $\mathrm{e}^x$ for approximating this pdf?

1

There are 1 best solutions below

0
On

Cecil Hastings, in his book Approximations for Digital Computers, gives a rational function approximation to $\exp(-x)$ for $0 \leq x < \infty$ that gives results that are good to $\approx 6$ digits:

$$\exp(-x)\approx R(x)=\frac1{(1+c_1 x+c_2 x^2+c_3 x^3+c_4 x^4+c_5 x^5+c_6 x^6)^4}$$

where

$$\begin{align*} c_1&=0.2499986842\\ c_2&=0.0312575832\\ c_3&=0.0025913712\\ c_4&=0.000171562\\ c_5&=5.4302\times 10^{-6}\\ c_6&=6.906\times 10^{-7} \end{align*}$$

Here's a plot of $R(x)-\exp(-x)$:

plot of R(x)-\exp(-x)

Hastings's book gives other, simpler approximations you can use if you have less stringent accuracy requirements. You can now plug this into your $\chi^2$ PDF expression to get the approximation you need.