Prev: Integer operands are required for colon operator when used asindex
Next: GADS toolbox gacreationlinearfeasible
From: Mehdi on 20 Oct 2009 09:56 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
From: Brian Borchers on 20 Oct 2009 10:09 On Oct 20, 7:56 am, Mehdi <zeido...(a)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.
From: Mehdi on 20 Oct 2009 13:17
On Oct 20, 8:09 am, Brian Borchers <borchers.br...(a)gmail.com> wrote: > On Oct 20, 7:56 am, Mehdi <zeido...(a)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 |