E[Log(x+a)] when x has gamma distribution

127 Views Asked by At

Is there a formula for this using built-in functions in matlab or mathematica like the Gamma functions or Ei's?

$$\int_0^\infty \log(x+a)e^{-\alpha x}x^\beta dx. $$

Thanks.

1

There are 1 best solutions below

2
On BEST ANSWER

Matlab's int apparently can't solve this (R2013b), but if you have Mathematica you can use Integrate:

Simplify[Integrate[Log[x+a] Exp[-alpha x] x^beta, {x, 0, Infinity}]]

which returns a long result in terms of a $_2F_2$ hypergeometric function using HypergeometricPFQ, a PolyGamma function (specifically a digamma), and several gamma functions and trigonometric functions. These can all be readily translated to Matlab if desired. Matlab's hypergeom does require the symbolic math toolbox even if you want floating-point results. Also, the Matlab "equivalent" of Mathematica's PolyGamma is the psi function.

Because of the presence of the hypergeometric function (and it's not one of the nicer ones), if this is a computational problem rather than one of analysis, you might be better off trying to solve the integral via quadrature (e.g., integral in Matlab). This could prove to be more computationally efficient and sufficiently accurate if appropriate tolerances are specified and parameters don't place the equation in extreme/unstable conditions. However, it's also possible that you can find a suitable approximation for the hypergeometric function in certain cases.