MATLAB Answers

# What is the convolution of two probability distribution estimate (ksdensity in matlab)?

4 views (last 30 days)
Imane Imane on 10 Nov 2016
Commented: Ahmet Cecen on 11 Nov 2016
Hello Everyone I am wondering how to perform the convolution of two ksdenity given that their vectors are not related. Here is an example of two sampling height data:
[f1,x1]=ksdenity(data_height_1);
[f2,x2]=ksdenity(data_height_2);
How to convolute f1 with f2? what would be the resulted height vector ?
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Ahmet Cecen on 11 Nov 2016
Use:
[f,xi] = ksdensity(x,pts)
To sample them at the same points, even if you have to sample a long tail of zeros to do so. Then just do:
conv(u,v)
##### 4 CommentsShowHide 3 older comments
Ahmet Cecen on 11 Nov 2016
No, the tool is x = conv(u,v) I was addressing your question about how to interpret the resulting vector x.

Sign in to comment.

### Community Treasure Hunt

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

Start Hunting!