MATLAB Answers

How to extract a PDF from points with a weigh attached to them

2 views (last 30 days)
Bert Taekels
Bert Taekels on 18 Oct 2017
Edited: Peter Cook on 18 Oct 2017
I Have a n by 3 matrix (lets say n = 100) where the 2 first collums are the x and y position of the point. The third collum is the weight of the particle (that got updated in a previous command). Now I would like to extract a bivariate norm pdf from these weighted points. I have found the fitgmdist command, but this does not include the weight of the points. Is there a way to do this. I have to say i'm still quite new in the matlab software Thanks

Answers (1)

Peter Cook
Peter Cook on 18 Oct 2017
Edited: Peter Cook on 18 Oct 2017
I don't know if there's a canned function for this - you could try:
1. Compute weighted mean for each column of X
2. Compute covariance matrix using weighted mean (or skip #1 and compute a weighted covariance matrix directly - I am not sure if this produces the exact same result)
3. Compute eigenvalues & eigenvectors of covariance matrix
4. Use the eigenvectors corresponding to 2 largest eigenvalues to extract coefficients for the bivariate normal distribution

Community Treasure Hunt

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

Start Hunting!

Translated by