Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inverse of the Chi-square CDF

584 views
Skip to first unread message

JohnM

unread,
Jun 8, 2012, 1:16:16 AM6/8/12
to
Hello. I need to calculate the inverse of the Chi-square cumulative distribution function. Can someone tell me how to do this without the functions in the Statistics toolbox because I do not have it installed. Thanks.

Nasser M. Abbasi

unread,
Jun 8, 2012, 1:59:26 AM6/8/12
to
On 6/8/2012 12:16 AM, JohnM wrote:

> Hello. I need to calculate the inverse of the Chi-square cumulative distribution function.

You question is a little confusing.

There are

Chi-square PDF
Chi-square CDF
Inverse-chi-squared PDF
Inverse-chi-squared CDF

But what does "the inverse of the Chi-square cumulative distribution" mean?

Is it the mathematical inverse of the CDF of "Chi-square distribution"

or is it

the CDF of "Inverse-chi-squared distribution"?

There is a BIG difference.

Either way, wiki has the definitions for "Inverse-chi-squared CDF"
and it has the definition for "Chi-square CDF" which you can
try to inverse.

--Nasser

John D'Errico

unread,
Jun 8, 2012, 7:34:07 AM6/8/12
to
"JohnM" wrote in message <jqs1r0$6rg$1...@newscl01ah.mathworks.com>...
> Hello. I need to calculate the inverse of the Chi-square cumulative distribution function. Can someone tell me how to do this without the functions in the Statistics toolbox because I do not have it installed. Thanks.

Its been a while since I wrote codes for these things, but I'm
pretty sure I recall that a chi-square random variable can
be converted into a gamma by transformation. In that case
you can use gammaincinv, the inverse incomplete gamma to
solve your problem. (Or maybe it is a transformation into an
F, which will then give you a beta RV, so use the inverse
incomplete beta, as found in betaincinv.)

John

JohnM

unread,
Jun 8, 2012, 1:52:13 PM6/8/12
to
"Nasser M. Abbasi" <n...@12000.org> wrote in message <jqs4bu$5jo$1...@speranza.aioe.org>...
Hi Nasser. Thanks for the response.
To eliminate any confusion, I am trying to calculate exactly what the the matlab chi2inv(P,V) function in the Statistics Toolbox does. It computes the inverse of the chi-square CDF. I don't have the toolbox though, and I am sure with some gymnastics involving the gammaincinv function, I can get there. Any advice?

JohnM

unread,
Jun 8, 2012, 2:01:12 PM6/8/12
to
"John D'Errico" <wood...@rochester.rr.com> wrote in message <jqsnvf$2e5$1...@newscl01ah.mathworks.com>...
Hi John. Thanks for the response. I have very little experience with chi-square statistics. I think you are correct about the application of gammaincinv but I can't find an reference indicating how to scale its arguments correctly. The inverse CDF functions (no matter the underlying density fn) are always a little non-intuitive to me.

Bruno Luong

unread,
Jun 8, 2012, 3:11:16 PM6/8/12
to
"JohnM" wrote in message <jqtel8$gm6$1...@newscl01ah.mathworks.com>...
> I can't find an reference indicating how to scale its arguments correctly.

You should not look very far : The formula is right on Wikipedia page - for example:
http://en.wikipedia.org/wiki/Chi-squared_distribution

Bruno

MarekJ

unread,
Jul 23, 2015, 8:39:11 AM7/23/15
to
"JohnM" wrote in message <jqs1r0$6rg$1...@newscl01ah.mathworks.com>...
> Hello. I need to calculate the inverse of the Chi-square cumulative distribution function. Can someone tell me how to do this without the functions in the Statistics toolbox because I do not have it installed. Thanks.

Just use
gammaincinv(P,V/2)*2
instead of
chi2invx(P,V)

The result should be the same.
0 new messages