Re: How to get probability of chi-sqares distribution?



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
.



Relevant Pages

  • Re: How to get probability of chi-sqares distribution?
    ... When you give such a large range as 0 to 1514, 'quad' ... it finds is that all the values are zero or almost zero, ... The first four points are large enough that the approximation QUAD uses ... For the case where the rightmost limit of integration is 1514, ...
    (comp.soft-sys.matlab)
  • Re: function handle
    ... However, QUAD calls your function with a vector, ... element-by-element multiplication. ... always return values between zero and one but it does not. ... I suspect the limits of integration you're using is the cause of the ...
    (comp.soft-sys.matlab)
  • Re: This is What Einstein Actually Did.
    ... |>|>| during this race is zero, ... |>|>velocity, you stupid cunt, and the velocity is zero. ... |>We know that already, neither does Phuckwit Duck. ... you'll never understand integration. ...
    (sci.physics.relativity)
  • Re: about QUAD... with IF
    ... What's the proper way to calculate integration for such ... The function 'quad' requires that the function you designate in the ... intended to handle discontinuous functions. ... If you don't want to use 'trapz', it would be better to break up the ...
    (comp.soft-sys.matlab)
  • Re: calculous in the curve space theorem 3
    ... and that's zero, not 1, over any finite interval of integration. ... Of course your whole notion of infinitesimals seems to be very half- ... What about case when dx and sindx like a function cannot expres ...
    (sci.physics.relativity)