# hampel (Scripts) 1.0

Average Rating
User Rating:
Visitors Rating:
My rating:

See full specifications

## hampel (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.

References
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.

Acknowledgements
I would like to thank Ronald K. Pearson for the introduction to moving
window filters. Please visit his blog at:
http://www.r-bloggers.com/moving-window-filters-and-the-pracma-package/

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.

Examples
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

## Most Popular

ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation