moving window chi square test for outlier removal

7 visualizaciones (últimos 30 días)
nlm
nlm el 31 de Mzo. de 2020
Comentada: nlm el 1 de Abr. de 2020
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

Respuestas (1)

Cris LaPierre
Cris LaPierre el 31 de Mzo. de 2020
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 comentario
nlm
nlm el 1 de Abr. de 2020
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 ?

Iniciar sesión para comentar.

Categorías

Más información sobre Hypothesis Tests en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by