moving window chi square test for outlier removal

조회 수: 2 (최근 30일)
nlm
nlm 2020년 3월 31일
댓글: nlm 2020년 4월 1일
Hi,
I'm trying to apply a chi-square test with a moving window 10 on a vector. I want ot replace the outliers with NaN within that window, if chi-sqaure >2*standard deviation. Any suggestions?
n=length(yy)
R(i) = abs( yy(i) - mean(yy) ) / std(yy);
% statistical test to find outliers
lamda = 2*sd(yy)
if R(i) > lambda
index = is(n-i+1:end);
index = [ index1 is(n-i+1) ];
end

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 3월 31일
One thought would be to use the interactive task in live scripts to find, fill or remove outliers. It might not be sophisticated enough to fully do what you want, but it definitely can get you started. Once you have what you want, you can export it as code and further modify that to meet your needs.
  댓글 수: 1
nlm
nlm 2020년 4월 1일
Thanks for the suggestion. However, It has limited options and does not have chi square test for outlier detection. Do you have any ideas for that ?

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

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by