Re: How to get probability of chi-sqares distribution?
- From: ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx (Roger Stafford)
- Date: Thu, 24 Aug 2006 06:12:57 GMT
In article <ef3ebd5.2@xxxxxxxxxxxxxxxxxxxxxxx>, Tab
<jilingerandtab@xxxxxxx> wrote:
Thank you Peter and Roger:-----------------------
What I don't understand is:
func = @(x)chi2pdf(x,21);
p1=quad(func, 0, 114);
it returns a value of 1.
func = @(x)chi2pdf(x,21);
p=quad(func, 0, 1514);
It returns a value of
5.5235e-011.
I think that in the latter case, the integration range is bigger than
that of the former one. Should the latter case return a value no less
than the former one?
Thank you again
Tab
Peter has told you why that is, Tab. What it amounts to is this (as I
understand it.) When you give such a large range as 0 to 1514, 'quad'
first chooses a set of uniformly-spaced values of x over that range to
determine some of the characteristics of the integrand's variation. What
it finds is that all the values are zero or almost zero, since it misses
that very short interval near the left side where essentially all the
important density values are located. Hence 'quad' decides the integral
is, to all intents and purposes, zero. With the narrower limits 0 to 114,
'quad' manages to catch one or more significant non zero values at the
left and then begins centering its attention on them. Thus it obtains an
accurate integral value.
Probably what you would need to avoid this pitfall is a way of informing
'quad' how finely divided its first set of integrand evaluations should be
so as to be sure not to miss the location of significant values. Have you
tried using other quadrature functions such as 'quad8' or 'quadl', perhaps
with tight tolerance settings?
Roger Stafford
.
- Follow-Ups:
- Re: How to get probability of chi-sqares distribution?
- From: Steven Lord
- Re: How to get probability of chi-sqares distribution?
- References:
- How to get probability of chi-sqares distribution?
- From: Tab
- Re: How to get probability of chi-sqares distribution?
- From: Peter Perkins
- Re: How to get probability of chi-sqares distribution?
- From: Tab
- How to get probability of chi-sqares distribution?
- Prev by Date: Re: Create surface from scattered 3D data
- Next by Date: Genetic Algorithm
- Previous by thread: Re: How to get probability of chi-sqares distribution?
- Next by thread: Re: How to get probability of chi-sqares distribution?
- Index(es):
Relevant Pages
|