How to generate a filter to remove outliers from a time series in Matlab?

0

I would like to create a low-pass filter to remove outliers from a time series.

They are sea surface temperature (tsm) data, in this series there are some data that are outliers and do not know very well how to create a low-pass filter, could anyone help me?

NOTE: The tsm data is in vector form. The sampling frequency I think is 5 minutes.

I'm starting to mess with Matlab now and I'm not sure how to do it.

Thank you.

    
asked by anonymous 23.06.2017 / 16:39

1 answer

0

There are different techniques for different purposes, but in general the removal of Outliers are identified and removed from a vector in the following way:

X = 1:100;
X = X';
noise = randn(100,1);
noise2 = 10*randn(100,1);
noise(11:20:91) = noise2(11:20:91);
Y = 3*X + 2 + noise;
stats = regstats(Y,X,'linear');
potential_outlier = stats.cookd > 4/length(X);
X(potential_outlier)
scatter(X,Y, 'b.')
hold on
scatter(X(potential_outlier),Y(potential_outlier), 'r.')

You can check this code better Here with explanations

    
23.06.2017 / 16:47