MATLAB How Can I Perform Double Numerical Integration in MATLAB or Mathematica?

AI Thread Summary
The discussion revolves around finding the cumulative distribution function (CDF) of a random variable defined by a specific probability density function (PDF) derived from its characteristic function. The PDF involves a complex integral that includes the exponential integral function. The user seeks guidance on performing numerical integration in MATLAB, having previously used Mathematica, which they found easier for such tasks. Key points include the ability to interchange integrals and the necessity of symbolic integration to obtain a function of alpha rather than a numerical result. The use of MATLAB's Symbolic Math Toolbox and the expint function is recommended for achieving the desired symbolic results. The user expresses a newfound understanding that symbolic integration can yield functions rather than just numerical outputs.
EngWiPy
Messages
1,361
Reaction score
61
I have the pdf of a random variable found from the characteristic function given by

f_X(\alpha)=\frac{1}{2\pi}\sum_{m=0}^Mj^m{K\choose m}\int_0^{\infty}e^{-jt(m+\alpha)}E_1^m(-jt)\,dt

where ##j=\sqrt{-1}## and ##E_1(x)## is the exponential integral. I need to find the CDF of the random variable ##X## which is given by

F_X(x)=\int_0^xf_X(\alpha)\,d\alpha

I can interchange the integrals, but I ended with two numerical integrations as well.

How can I do this in MATLAB? Is it easier to do in Mathematica?
 
Physics news on Phys.org
First, how can I evaluate ##
\int_0^{\infty}e^{-jt(m+\alpha)}E_1^m(-jt)\,dt
## numerically in MATLAB? Previously I used Mathematica because I felt it is easier to use for numerical integration, but now I have access to MATLAB only. Note that the result will be a function of ##\alpha## and not a number.
 
If you want the result in terms of alpha and not a number, then you want to do symbolic integration not numerical integration (the latter uses quadrature methods and produces a number).

Check out the int function in Symbolic Math Toolbox. You'll also need to use the expint function to form the integrand.
 
  • Like
Likes EngWiPy
kreil said:
If you want the result in terms of alpha and not a number, then you want to do symbolic integration not numerical integration (the latter uses quadrature methods and produces a number).

Check out the int function in Symbolic Math Toolbox. You'll also need to use the expint function to form the integrand.

OK, so, it's possible. I thought numerical integrations result only in numbers. I will check that out. Thanks
 

Similar threads

Replies
13
Views
2K
Replies
1
Views
2K
Replies
44
Views
6K
Replies
5
Views
2K
Replies
1
Views
3K
Replies
8
Views
3K
Back
Top