Author 
Message 
glare22@gmail.com science forum beginner
Joined: 12 Jul 2006
Posts: 7

Posted: Wed Jul 12, 2006 9:08 am Post subject:
Is there a program for numerically integrating a PDF to get CDF



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 

Back to top 


Peter Spellucci science forum Guru
Joined: 29 Apr 2005
Posts: 702

Posted: Wed Jul 12, 2006 10:27 am Post subject:
Re: Is there a program for numerically integrating a PDF to get CDF



In article <1152695303.927180.168540@m79g2000cwm.googlegroups.com>,
glare22@gmail.com writes:
Quote:  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,nonautomatic
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 

Back to top 


glare22@gmail.com science forum beginner
Joined: 12 Jul 2006
Posts: 7

Posted: Wed Jul 12, 2006 8:38 pm Post subject:
Re: Is there a program for numerically integrating a PDF to get CDF



Thanks a lot.
I have tried to use dqk61 to estimate the value in a small range of
0.0125 where the peak exists, I get a very large number. I will try
dqagi and dqags.
Peter Spellucci wrote:
Quote:  In article <1152695303.927180.168540@m79g2000cwm.googlegroups.com>,
glare22@gmail.com 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,nonautomatic
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 


Back to top 


Google


Back to top 



The time now is Thu Nov 15, 2018 6:30 pm  All times are GMT

