Convolution of two probability density function
조회 수: 10 (최근 30일)
이전 댓글 표시
Hello:
I am interested to add two independent random variables, X1 and X2, described by kernel density functions. Is there any way to find out the joint PDF using convolution process in MATLAB?
댓글 수: 0
답변 (1개)
Jeff Miller
2019년 9월 24일
I don't know whether you can do this directly in MATLAB. If not, you can do it using the Cupid toolbox. Here is an example:
% Generate some data to use for an example:
data1 = randn(200,1);
data2 = 20*rand(300,1);
% Make the corresponding MATLAB kernel distribution objects:
kern1 = fitdist(data1,'Kernel');
kern2 = fitdist(data2,'Kernel');
% Derive Cupid distribution objects from MATLAB ones:
ckern1 = dMATLABc(kern1);
ckern2 = dMATLABc(kern2);
% Make a Convolution distribution from the Cupid distribution objects:
convkern = Convolution(ckern1,ckern2);
% Compute various properties of the convolution distribution:
a = convkern.Median
b = convkern.Mean
c = convkern.Variance
d = convkern.PDF(12)
e = convkern.CDF(13)
convkern.PlotDens; % Plot PDF and CDF
% et cetera
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!