Effacer les filtres
Effacer les filtres

removing outlier from data

4 vues (au cours des 30 derniers jours)
Mayssa Chouat
Mayssa Chouat le 11 Nov 2022
Commenté : Mayssa Chouat le 18 Nov 2022
Hi everyone
I'm trying to remove outliers from a vector of data in this way:
each 100 elemnts of the vector has to be filtered separatly from the others: from 1 to100, from 101-2001 and so on.
I tried it using B=rmoutliers(A,movmean,100) but I'm not quiet sure what does the 100-element Window exactly do. Does it move the way I described it above ?
Thank u in advance

Réponse acceptée

Chris
Chris le 11 Nov 2022
Modifié(e) : Chris le 11 Nov 2022
It's a sliding window. From the text in the function:
% B = RMOUTLIERS(A,..., MOVMETHOD, WL) uses a moving window method to
% determine contextual outliers instead of global outliers. MOVMETHOD can
% be 'movmedian' or 'movmean'.
You'll probably have to write your own function to divide the vector into chunks like you want. It's easy enough with a for loop. Something like:
for idx = 1:100:numel(vec)/100
chunk = vec(idx:idx+100);
% chunk(isoutlier(chunk)) = nan; one option
% filtered(idx:idx+100) = chunk;
filtered(idx:idx+100) = filloutliers(chunk, 'linear');
end
  1 commentaire
Mayssa Chouat
Mayssa Chouat le 18 Nov 2022
Thank u so much

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 11 Nov 2022
From the help:
B = rmoutliers(A,movmethod,window) detects local outliers using a moving window mean or median with window length window. For example, rmoutliers(A,"movmean",5) defines outliers as elements more than three local standard deviations from the local mean within a five-element window.
Seems pretty clear and explicit to me. What didn't you understand? Your signal might move all over the place and the rmoutliers() when used in that way, only looks in a certain window around the current point to determine what is or is not an outlier.
  1 commentaire
Mayssa Chouat
Mayssa Chouat le 18 Nov 2022
Thank u

Connectez-vous pour commenter.

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by