Convolution of two probability density function

14 visualizaciones (últimos 30 días)
Poulomi Ganguli
Poulomi Ganguli el 23 de Sept. de 2019
Respondida: Jeff Miller el 24 de Sept. de 2019
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?

Respuestas (1)

Jeff Miller
Jeff Miller el 24 de Sept. de 2019
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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by