How to implement MonteCarlo integration of probability density function to obtain CDF

조회 수: 13 (최근 30일)
Hello:
I have a probability density function obtained from convolution process of two random variables. Hence, I don't have the functional form of the PDF. Now, I am interested to integrate the PDF numerically using Montecarlo method. I came across a few file exchage page, for example: https://de.mathworks.com/matlabcentral/fileexchange/53477-monte-carlo-integration
But above require functional form. Any suggestions/help how do I integrate the PDF using Montecarlo method to get corresponding CDF?
  댓글 수: 4
John D'Errico
John D'Errico 2019년 10월 11일
편집: John D'Errico 2019년 10월 11일
Note that trapezoidal rule integration is not an EXACT integral. It is an approximation. The magnitude of the error will be impacted by the increment, generally larger for larger increments. So why are you surprised at the result?
Poulomi Ganguli
Poulomi Ganguli 2019년 10월 11일
So, I want MonteCarlo method to get better CDF estimate.

댓글을 달려면 로그인하십시오.

채택된 답변

Abhishek Kumar
Abhishek Kumar 2020년 12월 8일
Hi Poulomi, as I understand you have PDF of your desired function as convolution of two random functions(assuming f1,f2), you also have the file exchange script as you have mentioned hence you can use the following strategy.
(desired PDF as pdf)
pdf = conv(f1,f2);
[cdf,E,R,info]=integralN_mc(pdf);
"integralN_mc" being the function created under the script, you can use other variations of the functions as described in the script as well.
Please do share what input random functions you are using for further help if your query is not resolved.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by