I am trying to reproduce the (upper-tail) critical values of chi-square distribution with ν degrees of freedom as reported here. As a test I looked at $\nu=2$ and the probability $0.99$.
As far as I can tell, in Mathematica the ChiSquare distribution is implemented in ChiSquareDistribution
, so here is what I tried to do to find the value:
NIntegrate[PDF[ChiSquareDistribution[2], x], {x, 99/100, Infinity}]
However, this gives 0.609571
. Do I need to scale this value to get the desired result?
Quantile[ChiSquareDistribution[2], .99]
orNSolve[CDF[ChiSquareDistribution[2], t] == 99/100, t, Reals]
? $\endgroup$InverseCDF[ChiSquareDistribution[2],99/100]
as well. $\endgroup$PDF
:FindRoot[Integrate[PDF[ChiSquareDistribution[2], x], {x, 0, xf}] == 0.99
, {xf, 1}] // Quiet` orAssuming[xf > 0, Solve[Integrate[PDF[ChiSquareDistribution[2], x], {x, 0, xf}] == 0.99
, xf]] // Quiet` $\endgroup$NIntegrate[PDF[ChiSquareDistribution[2], x], {x, 0, 9.21034}]
. To obtain the desired value (9.21034) you'd need to follow any of the above comments. $\endgroup$