필터 지우기
필터 지우기

fitting scatter plot with two-dimensional normal distribution (Gaussian)?

조회 수: 11 (최근 30일)
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

채택된 답변

Jeff Miller
Jeff Miller 2019년 2월 28일
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?

추가 답변 (2개)

buthayna alnaalwa
buthayna alnaalwa 2019년 3월 1일
thanks, can you help me how to caluclate those parameters, still new user!
  댓글 수: 2
buthayna alnaalwa
buthayna alnaalwa 2019년 3월 1일
also the point is for me i need every time to fit one normal distribution Gaussian , by having two Gaussians i will have like ellipsoidal shape as i understood,,,, but when i tried to fit one gaussian it gave only straight line so no ellipsoidal shape as intersect
Jeff Miller
Jeff Miller 2019년 3월 1일
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

댓글을 달려면 로그인하십시오.


buthayna alnaalwa
buthayna alnaalwa 2019년 3월 5일
thanks for your help

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by