Thread Subject: Problem with chi2pdf command

Subject: Problem with chi2pdf command

From: Mehdi

Date: 20 Oct, 2009 13:56:10

Message: 1 of 3

Hello everyone:
I am using the command below to find the probability of chi-square
larger than 0.0052 with 1 degree of freedom: chi2pdf(0.0052,1)
for this I am getting a probability of 5.5164 which is larger than 1
(the probability should vary between 0 and 1). Any comment on this is
much appreciated.

Yours,
Mehdi

Subject: Problem with chi2pdf command

From: Brian Borchers

Date: 20 Oct, 2009 14:09:59

Message: 2 of 3

On Oct 20, 7:56 am, Mehdi <zeido...@gmail.com> wrote:
> Hello everyone:
> I am using the command below to find the probability of chi-square
> larger than 0.0052 with 1 degree of freedom: chi2pdf(0.0052,1)
> for this I am getting a probability of 5.5164 which is larger than 1
> (the probability should vary between 0 and 1). Any comment on this is
> much appreciated.
>
> Yours,
> Mehdi

You want the CDF, not the pdf, of the Chi^2 distribution. Use chi2cdf
instead.

Subject: Problem with chi2pdf command

From: Mehdi

Date: 20 Oct, 2009 17:17:46

Message: 3 of 3

On Oct 20, 8:09 am, Brian Borchers <borchers.br...@gmail.com> wrote:
> On Oct 20, 7:56 am, Mehdi <zeido...@gmail.com> wrote:
>
> > Hello everyone:
> > I am using the command below to find the probability of chi-square
> > larger than 0.0052 with 1 degree of freedom: chi2pdf(0.0052,1)
> > for this I am getting a probability of 5.5164 which is larger than 1
> > (the probability should vary between 0 and 1). Any comment on this is
> > much appreciated.
>
> > Yours,
> > Mehdi
>
> You want the CDF, not the pdf, of the Chi^2 distribution.  Use chi2cdf
> instead.

Thanks for your answer. You're right. Actually I should have used 1-
chi2cdf(0.0052,1).
Mehdi

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com