FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » num-analysis
Is there a program for numerically integrating a PDF to get CDF
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Paul Abbott
science forum addict


Joined: 19 May 2005
Posts: 99

PostPosted: Mon Jul 17, 2006 7:40 am    Post subject: Re: Is there a program for numerically integrating a PDF to get CDF Reply with quote

In article <1152736858.550214.324000@m73g2000cwd.googlegroups.com>,
glare22@gmail.com wrote:

Quote:
Yes, the PDF has the anaytical funciton as p=
exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))^2/8/u2^2/sqrt(2*pi*abs(u1^2+4*u2*(u-u
0+u2))).
u0 is mean, u1 is standard deviation, u2 is the skewness.

This is inconsistent. Analytic computation of the mean of this PDF yields

mean = u0 - u2 - u1^2/(4 u2)

Quote:
what should I do?

Also, note that other moments of this PDF can be computed in
closed-form. For example, the variance is

(u1^4 BesselK[6, u1/(4 Sqrt[2 Pi] u2^2)])/
(16 u2^2 BesselK[2, u1/(4 Sqrt[2 Pi] u2^2)])

Since you have access to Mathematica, it is straightforward to use
NDSolve to compute the CDF.

Cheers,
Paul

_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul
Back to top
glare22@gmail.com
science forum beginner


Joined: 12 Jul 2006
Posts: 7

PostPosted: Fri Jul 14, 2006 11:44 pm    Post subject: Re: Is there a program for numerically integrating a PDF to get CDF Reply with quote

Thank Torsten a lot.

Torsten Hennig wrote:
Quote:
Torsten Hennig wrote:
I want to get the CDF from the integration of a given >PDF. Is there any
good codes I can use for this purpose? Currently I use >the program
dqk15i.f from the quadpack. But the result is not good. >especially, for
the PDF with a sharp peak, it gives totally wrong >results. Is there any
other programs which can deal with semi-infinite range? >Is there anyone
can help me? Thanks.

Hi,

in which form is the pdf given ? analytic formula ?
number of hits in a finite number of intervals resulting
from a monte-carlo-simulation ?

Best wishes
Torsten.



Yes, the PDF has the anaytical funciton as p=
exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))^2/8/u2^2/sqrt>(2*pi*abs(u1^2+4*u2*(u-u0+u2))).
u0 is mean, u1 is standard deviation, u2 is the skewness.
what should I do? Thanks.

Hi,

let u*>0 be such that the pdf is small for |u|>u*.
Then use an integrator for ordinary differential
equations to solve the problem
F'(u)= exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))
^2/8/u2^2/sqrt(2*pi*abs(u1^2+4*u2*(u-u0+u2))),
with initial condition F(-u*)=0 in the range [-u*,u*].

Good integrators for ODEs automatically choose the
step size adaptively so that sharp gradients
in the cdf should be well resolved.

Of course, because the ODE does not contain the
dependent variable F, the use of quadpack is also
possible. Then follow Peter's advice.

Best wishes
Torsten.
Back to top
Torsten Hennig
science forum Guru Wannabe


Joined: 28 Apr 2005
Posts: 136

PostPosted: Thu Jul 13, 2006 7:11 am    Post subject: Re: Is there a program for numerically integrating a PDF to get CDF Reply with quote

Torsten Hennig wrote:
Quote:
I want to get the CDF from the integration of a given >PDF. Is there any
good codes I can use for this purpose? Currently I use >the program
dqk15i.f from the quadpack. But the result is not good. >especially, for
the PDF with a sharp peak, it gives totally wrong >results. Is there any
other programs which can deal with semi-infinite range? >Is there anyone
can help me? Thanks.

Hi,

in which form is the pdf given ? analytic formula ?
number of hits in a finite number of intervals resulting
from a monte-carlo-simulation ?

Best wishes
Torsten.



Yes, the PDF has the anaytical funciton as p=
exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))^2/8/u2^2/sqrt>(2*pi*abs(u1^2+4*u2*(u-u0+u2))).
u0 is mean, u1 is standard deviation, u2 is the skewness.
what should I do? Thanks.

Hi,

let u*>0 be such that the pdf is small for |u|>u*.
Then use an integrator for ordinary differential
equations to solve the problem
F'(u)= exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))
^2/8/u2^2/sqrt(2*pi*abs(u1^2+4*u2*(u-u0+u2))),
with initial condition F(-u*)=0 in the range [-u*,u*].

Good integrators for ODEs automatically choose the
step size adaptively so that sharp gradients
in the cdf should be well resolved.

Of course, because the ODE does not contain the
dependent variable F, the use of quadpack is also
possible. Then follow Peter's advice.

Best wishes
Torsten.
Back to top
glare22@gmail.com
science forum beginner


Joined: 12 Jul 2006
Posts: 7

PostPosted: Wed Jul 12, 2006 8:40 pm    Post subject: Re: Is there a program for numerically integrating a PDF to get CDF Reply with quote

Yes, the PDF has the anaytical funciton as p=
exp(-(u1+sqrt(abs(u1^2+4*u2*(u-u0+u2))))^2/8/u2^2/sqrt(2*pi*abs(u1^2+4*u2*(u-u0+u2))).
u0 is mean, u1 is standard deviation, u2 is the skewness.
what should I do? Thanks.


Liang

Torsten Hennig wrote:
Quote:
I want to get the CDF from the integration of a given >PDF. Is there any
good codes I can use for this purpose? Currently I use >the program
dqk15i.f from the quadpack. But the result is not good. >especially, for
the PDF with a sharp peak, it gives totally wrong >results. Is there any
other programs which can deal with semi-infinite range? >Is there anyone
can help me? Thanks.

Hi,

in which form is the pdf given ? analytic formula ?
number of hits in a finite number of intervals resulting
from a monte-carlo-simulation ?

Best wishes
Torsten.
Back to top
Torsten Hennig
science forum Guru Wannabe


Joined: 28 Apr 2005
Posts: 136

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

Quote:
I want to get the CDF from the integration of a given >PDF. Is there any
good codes I can use for this purpose? Currently I use >the program
dqk15i.f from the quadpack. But the result is not good. >especially, for
the PDF with a sharp peak, it gives totally wrong >results. Is there any
other programs which can deal with semi-infinite range? >Is there anyone
can help me? Thanks.

Hi,

in which form is the pdf given ? analytic formula ?
number of hits in a finite number of intervals resulting
from a monte-carlo-simulation ?

Best wishes
Torsten.
Back to top
glare22@gmail.com
science forum beginner


Joined: 12 Jul 2006
Posts: 7

PostPosted: Wed Jul 12, 2006 9:02 am    Post subject: Is there a program for numerically integrating a PDF to get CDF Reply with quote

I want to get the CDF from the integration of a given PDF. Is there any
good codes I can use for this purpose? Currently I use the program
dqk15i.f from the quadpack. But the result is not good. especially, for
the PDF with a sharp peak, it gives totally wrong results. Is there any
other programs which can deal with semi-infinite range? Is there anyone
can help me? Thanks.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Mon Dec 18, 2017 12:40 pm | All times are GMT
Forum index » Science and Technology » Math » num-analysis
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts How to solve linear program with matrix variable ? Fan num-analysis 4 Thu Jul 13, 2006 5:55 am
No new posts Is there a program for numerically integrating a PDF to g... glare22@gmail.com num-analysis 2 Wed Jul 12, 2006 9:08 am
No new posts DONT let the CHILD RAPING EVIL AMERICAN GOVT PSYCHOPATHS ... McGinnn Math 2 Sun Jul 09, 2006 10:28 pm
No new posts Integrating t^(-3/2) * e^(1/t) Konrad Viltersten Math 7 Wed Jul 05, 2006 2:27 pm
No new posts eCheminfo Drug Discovery Community of Practice Meeting, B... The Ferryman Chem 1 Tue Jun 27, 2006 2:17 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums  |  send newsletters
 


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1573s ][ Queries: 20 (0.1368s) ][ GZIP on - Debug on ]