histogram2 versus mvnpdf
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sylvia
am 18 Feb. 2020
Kommentiert: Sylvia
am 23 Feb. 2020
I have two variables and would like to create a joint PDF. I am mainly interested in the shape of the PDF and not the actual probability. My variables are two column arrays: u and v. I first tried using histrogram2(u, v), but was unsure if that was the correct function to use. I then tried using the mvnpdf function to check. I tried JPDF = mvnpdf( [u ,v] ). I then plotted the result with scatter3(u,v,JPDF). I got a different shaped distribution curve than the histrogram2 curve. Can anyone explain why they would produce different shaped curves?
0 Kommentare
Akzeptierte Antwort
Raunak Gupta
am 21 Feb. 2020
Hi,
The mvnpdf estimates the pdf value of each pair of variables with respect to zero mean and identity covariance matrix d-dimensional gaussian distribution where d is the number of variables. So, it uses the formula of multivariate normal distribution for calculation of those pdf values.
Whereas histogram2 just distributes the x and y variables as coordinates into the bins specified by the range of x and y variables and the number of bins.
So, the difference between the two is mvnpdf will give exact value according to multivariate normal distribution only while histogram2 will give the exact shape of the distribution based on the count of variables in specific range. For getting exact shape it requires data to be coming to all bins in histogram2 and there are enough instances of variable representing the distribution accurately.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!