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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com