Hi all,
Here is a description to the gamma density function:
http://en.wikipedia.org/wiki/Gamma_distribution
Basically, I am studying how to numerically integrate against the
gamma density function for kappa < 1.
As you can see, the key difficulty for the kappa < 1 case is that in
the integrand there is a term
x^(kappa-1)
and we have to integrate starting from x=0 all the way to x= +
infinity...
There is a very sharp peak at x=0, which leads to a lot of difficulty
for my Simpson's rule numerical integration scheme.
For some reason, I have to integrate by calculating the nodes and
weights myself. This is actually good - it helps me understand the
numerical integration better.
I want to learn the tricks in numerical integration field about how
experts handle such case...
Please shed some light on me...
Thanks a lot for your help!
Numerical integration with a singularity
There are three standard tricks:
(1) break up the interval of integration into pieces, one near the singularity (x=0 in this case), one near infinity, and one where everything behaves nicely.
(2) transform an improper integral to a nice smooth one on a finite interval
(3) subtract off the singular part and integrate that exactly.
For example, to integrate x^(kappa-1)*f(x) for x from 0 to 1, where f(x) is an analytic function in a neighbourhood of this interval and 0 < kappa < 1, you can use the Taylor series f(x) = sum(c[i]*x^i, i=0..4) + g(x), where g(x) = O(x^5) as x -> 0. Thus x^(kappa-1)*g(x) should be sufficiently nice (with 4 continuous derivatives) to behave well with Simpson's Rule, while int(x^(kappa-1+i), x=0..1) = 1/(kappa+i).
<p>Thanks
<p>Thanks Robert...</p>
<p>What if we don't know f(x) in closed-form, though f(x) is known to be nice, smooth, and bounded... We have to evaluate f(x) numerically and it consumes a lot of computational resouces in obtaining f(x)...</p>
<p>Any more thoughts?</p>
f(x)
In that case it may be better to use the transformation method, which does not require derivatives of f. The change of variables
takes
to