Calculating Integration including Gamma Function

2 views (last 30 days)
Hi,
I am new to Matlab. I want to calculate the function in the following link. v, delta and L are given. How to calculate this using Matlab?
Thanks in advance
Pagolmon

Answers (2)

John D'Errico
John D'Errico on 23 Jan 2011
Use a loop to create each term, summing the result as you go. A while loop allows you to do this, with a test inside the while statement to see if the terms are sufficiently small. Or, use a for loop, with a test inside the loop, then a call to break when the terms are sufficiently small.
Compute the terms using the log of each terms, then exponentiate each term before you sum it into the running sum. Gammaln here will be efficient to compute the log of the gamma function, but also the log of the factorial. The avoids partial underflows and overflows inside the terms because you use logs.
Beyond that, just start writing. The way to learn is to write the code yourself. If I do it for you, then you learn nothing.

Walter Roberson
Walter Roberson on 23 Jan 2011
I ran this through a bunch of transformations, and the only one that resulted in any kind of simplification was to rewrite the first term in terms of the binomial function:
sum((1-delta)^n*(GAMMA(v+n, x/delta)/GAMMA(v+n))^L*binomial(v+n-1, n), n = 0 .. infinity)
If you have constraints upon the delta, v, or L values, then it might perhaps be possible to make a further refinement. For example are any of the variables constrained to be positive integers? Is L at least an integer even if possibly negative?
  2 Comments
pagolmon
pagolmon on 24 Jan 2011
Thanks for the reply.
v and L values are positive integers.
In the condition it's written that the equation is exact for L<=2 and approximate for L>2.
v ranges from 0.005~0.01..
delta is equal to the determinant of a symmetric matrix.
Walter Roberson
Walter Roberson on 24 Jan 2011
I investigated further yesterday with L=2 and assumed integral v, but nothing I found could reduce the complexity of the summation in any meaningful form.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!