About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconhampel (Scripts) Publisher's description

HAMPEL(X,Y,DX,T) returns the Hampel filtered values of the elements in

HAMPEL(X,Y,DX,T) returns the Hampel filtered values of the elements in
Y. It was developed to detect outliers in a time series, but it can
also be used as an alternative to the standard median filter.

Chapters 1.4.2, 3.2.2 and 4.3.4 in Mining Imperfect Data: Dealing with
Contamination and Incomplete Records by Ronald K. Pearson.

I would like to thank Ronald K. Pearson for the introduction to moving
window filters. Please visit his blog at:

X,Y are row or column vectors with an equal number of elements.
The number of elements should at least be two.
The elements in Y should be Gaussian distributed.

DX,T are optional scalar values.
DX is a scalar which defines the half width of the filter window.
It is required that DX > 0 and DX should be dimensionally equivalent to
the values in X.

T is a scalar which defines the threshold value.

Standard Parameters for DX and T:
DX = 3*mean(X(2:end)-X(1:end-1));
T = 3;

Output YY, I, S are column vectors containing Hampel filtered values of
Y, a logical index of the replaced values and the local scaled median
absolute deviation, respectively.
NO is a scalar that specifies the number of outliers detected.

1. Hampel filter removal of outliers
X = 1:1000; % Pseudo Time
Y = 5000 + randn(1000, 1); % Pseudo Data
Outliers = randi(1000, 10, 1); % Index of Outliers
Y(Outliers) = Y(Outliers) + randi(1000, 10, 1); % Pseudo Outliers
[YY, I, S] = hampel(X,Y);

plot(X, Y, 'b.'); hold on; % Original Data
plot(X, YY, 'r'); % Hampel Filtered Data
plot(X, YY + 3*S, 'r'); % +3 times local Scaled MAD
plot(X, YY - 3*S, 'r'); % -3 times local Scaled MAD
plot(X(I), Y(I), 'ks'); % Identified outliers

System Requirements:

MATLAB 7.10 (2010a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

hampel (Scripts) Tags:

Click on a tag to find related softwares

Is hampel (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.