필터 지우기
필터 지우기

How to detect data that does not follow a bell curve?

조회 수: 1 (최근 30일)
Miguel
Miguel 2023년 9월 14일
댓글: Miguel 2023년 9월 14일
Hello everyone!
I have significantly large dataset and I need to detect which data does not follow a gaussian distribution or bell curve (see screenshots). I have tried using several tests such as kstest, lillietest, etc but for some reason, these tests do not work for me. I have tried using the histcounts function for visualizing the data distribution that you see in the screenshots. Any insights would be appreciated.
[N1,edges1,bin1] = histcounts(normal);
plot(N1)
[N2,edges2,bin2] = histcounts(abnormal);
plot(N2)

채택된 답변

Sam Chak
Sam Chak 2023년 9월 14일
Not sure if you can try it this way to compare the R-square value. Data that follows the bell curve tends to have a high R-squared value close to 1. Data that does not follow the bell curve usually have relatively low R-squared values.
load('normal.mat');
[N1,edges1,bin1] = histcounts(normal);
x1 = 1:length(N1);
[fitobject1, gof1] = fit(x1', N1', 'gauss1')
fitobject1 =
General model Gauss1: fitobject1(x) = a1*exp(-((x-b1)/c1)^2) Coefficients (with 95% confidence bounds): a1 = 3609 (3563, 3654) b1 = 45.27 (45.16, 45.38) c1 = 10.65 (10.5, 10.81)
gof1 = struct with fields:
sse: 8.9523e+05 rsquare: 0.9939 dfe: 189 adjrsquare: 0.9939 rmse: 68.8235
load('abnormal.mat');
[N2,edges2,bin2] = histcounts(abnormal);
x2 = 1:length(N2);
[fitobject2, gof2] = fit(x2', N2', 'gauss1')
fitobject2 =
General model Gauss1: fitobject2(x) = a1*exp(-((x-b1)/c1)^2) Coefficients (with 95% confidence bounds): a1 = 1862 (1450, 2274) b1 = 11.65 (-3.404, 26.7) c1 = 33.07 (15.12, 51.03)
gof2 = struct with fields:
sse: 9.6821e+07 rsquare: 0.3657 dfe: 99 adjrsquare: 0.3529 rmse: 988.9337
subplot(211)
plot(N1), grid on, title('N_{1} follows Bell curve')
subplot(212)
plot(N2), grid on, title('N_{2} does not follows Bell curve')
  댓글 수: 1
Miguel
Miguel 2023년 9월 14일
Hi Sam,
Thank you so much for your reply. I highly appreciate your help. This worked perfectly for my dataset. Have a nice day!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by