This question is related to Excel's CHIDIST function in MATLAB
The minimum answer larger than zero I can get in Excel is about 2.2e-308 that correspond to
realmin in MATLAB. However, in MATLAB the minimum answer is 2.2e-16, or
eps(1.0). I understand this is because I first calculate
chi2cdf that is close to 1 for large values, and the precision in this case is
Is there any other way to reproduce Excel's CHIDIST and not to loose the precision? Do you know exactly how CHIDIST works?
I have to do this test multiple times, and in many cases the resulting p-values are close to zero. I need to rank the p-values, this is why I need high precision in p-value calculation.