fitting scatter plot with two-dimensional normal distribution (Gaussian)?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
buthayna alnaalwa
am 28 Feb. 2019
Beantwortet: buthayna alnaalwa
am 5 Mär. 2019
Hi everyone,
I need to fit the attached scatter plot to 2-D normal distribution (Gaussian), as i undertood the expected result should be like ellipsoid, i tried so many think but i could reach what i want! e.g: when i tried the gaussian fit i got like straight line crossing y axis at zero...
this photo generated from x,y of 566*2 matrix.
thanks in advance
0 Kommentare
Akzeptierte Antwort
Jeff Miller
am 28 Feb. 2019
You can calculate the 5 parameters of the best estimated bivariate normal directly from the x and y values: mean & sd of each variable and Pearson correlation. What else do you want?
0 Kommentare
Weitere Antworten (2)
buthayna alnaalwa
am 1 Mär. 2019
2 Kommentare
Jeff Miller
am 1 Mär. 2019
MATLAB has nice functions to calculate the parameter, such as:
% Assume your data are in x,y
muX = mean(x);
sigmaY = std(y);
rhoXY = corr(x,y);
I don't really understand what you want, but your comments about ellipsoids suggest that you are trying to plot the bivariate distribution. The usual way to do that is with a surface plot. Here is a good example from Image Analyst: Previous Answer
You can use your mu & sigma values, computed as above, and adjust xl and yl to give ranges appropriate for the ranges of your x and y
Siehe auch
Kategorien
Mehr zu Scatter Plots 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!