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

Click For Summary

Discussion Overview

The discussion revolves around performing double numerical integration in MATLAB or Mathematica, specifically in the context of calculating the cumulative distribution function (CDF) of a random variable derived from its characteristic function. Participants explore methods for evaluating integrals that involve complex functions and the exponential integral.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents a formula for the probability density function (pdf) of a random variable and expresses the need to compute its cumulative distribution function (CDF) through double integration.
  • Another participant questions how to evaluate a specific integral numerically in MATLAB, noting their previous experience with Mathematica for similar tasks.
  • A third participant suggests that if the result is desired in terms of alpha rather than a numerical value, symbolic integration should be used instead of numerical integration, recommending the use of the int function in MATLAB's Symbolic Math Toolbox.
  • This participant also mentions the expint function as necessary for forming the integrand, indicating a potential misunderstanding about the nature of numerical versus symbolic integration.

Areas of Agreement / Disagreement

Participants express differing views on the appropriateness of numerical versus symbolic integration for the task at hand. There is no consensus on the best approach, as some advocate for symbolic methods while others focus on numerical techniques.

Contextual Notes

Participants have not fully resolved the implications of using numerical versus symbolic integration, and there may be limitations based on the specific functions involved and the capabilities of the software being used.

Who May Find This Useful

Individuals interested in numerical and symbolic integration techniques in MATLAB and Mathematica, particularly in the context of probability theory and statistical analysis.

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   Reactions: 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
27
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 44 ·
2
Replies
44
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 8 ·
Replies
8
Views
10K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K