How to find points 3 std away from the mean in vector

조회 수: 26 (최근 30일)
Olga
Olga 2014년 9월 9일
댓글: Image Analyst 2020년 8월 19일
Hello,
Could you please help me to find a way how to find the points which are 3 std away from the mean in vector?

채택된 답변

Image Analyst
Image Analyst 2014년 9월 9일
편집: Image Analyst 2014년 9월 9일
Assuming you really mean " more than 3 standard deviations away from the mean"...
% Get the mean and standard deviation of the vector
theMean = mean(yourVector);
stdDev = std(yourVector);
% Get a logical vector of the locations where the value is more than 3 sd away from the mean.
locationsAwayFromMean = abs(yourVector - theMean) > stdDev;
% Extract only those elements
outlierValues = yourVector(locationsAwayFromMean);
  댓글 수: 4
Filippe Frulli
Filippe Frulli 2020년 8월 19일
편집: Filippe Frulli 2020년 8월 19일
May I please ask how exactly is the 3*standard deviations calculated?
Based on my interpretation of Image Analyst's solution, I only see 1 standard deviation being calculated. I would really appreciate clarification.
Shouldn't it be
locationsAwayFromMean = abs(yourVector - theMean) > 3*stdDev?
Image Analyst
Image Analyst 2020년 8월 19일
Yes, sorry for the error and thanks for the clarification.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Elementary Math에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by