I am trying to simulate the approximation of the CDF of a chi-squared random variable, using the method proposed By Luisa Canal2006.
In Luisa Canal2006, the CDF of the $\chi_n^2$, denoted as $F_n(x,n)$, is approximated as $\Phi(\frac{x-\mu}{\sigma})$. And $\mu$ and $\sigma^2$ is calculated as
$$ \mu=\frac{5}{6}-\frac{1}{9 n}-\frac{7}{648 n^2}+\frac{25}{2187 n^3}\\ \sigma^2=\frac{1}{18 n}+\frac{1}{162 n^2}-\frac{37}{11664 n^3} $$
It seems easy to simulate the numerical results.
However, I did not figure out the mistake of my Matlab code. Here is my code:
The result in Luisa Canal2006 told that when $n=2$, the MAE (maximum absolute error) is just $1.8\times 10^{-3}$. Obviously, my result is not consistent with that in Luisa Canal2006.
So, can anyone give me suggestions about this mis-consistence?
Thanks!

