Re: Is there a program for numerically integrating a PDF to get CDF




In article <1152695303.927180.168540@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
glare22@xxxxxxxxx writes:
I want to get the CDF from the integration of a given PDF. Is there a
program I can use for this purpose? Currently I use qk15i from the
quadpack. But the result is not good. For the PDF with a sharp peak, it
gives totally wrong results. Can anyone help me? Thanks.


Liang


you are using the wrong code:
1. quadpack/qk15i.f ( plus dependencies )
gams: H2a3a2,H2a4a2
for: estimate 1D integral on (semi)infinite interval using a 15 point quadrature rule,non-automatic
prec: single
Score: 100%

first of all, switch to an adaptive automatic integrator. then you also must be
able to estimate the witdth of possible peaks in order to set the tolerances \so
tight such that the adaptive mechanism is forced the refine the grid
correspondingly. this is not too hard to do. with prior knowledge of
the integrand you can outwit any numerical integrator: it "sees" the integrand
only at the grid which is constructed automatically using some rules.
In your case, where you want to construct a table of a indefinite integral,
you can proceed stepwise, using a semiinfinte interval first with a strong
tolerance and then using finite intervals using other adaptive code from
quadpack.
dqagi and dqags would be a choice
hth
peter
.