Description Usage Arguments Details Value Note References See Also Examples

Median absolute deviation (MAD) outlier in Time Series

1 | ```
hampel(x, k, t0 = 3)
``` |

`x` |
numeric vector representing a time series |

`k` |
window length |

`t0` |
threshold, default is 3 (Pearson's rule), see below. |

The ‘median absolute deviation’ computation is done in the `[-k...k]`

vicinity of each point at least `k`

steps away from the end points of
the interval.
At the lower and upper end the time series values are preserved.

A high threshold makes the filter more forgiving, a low one will declare
more points to be outliers. `t0<-3`

(the default) corresponds to Ron
Pearson's 3 sigma edit rule, `t0<-0`

to John Tukey's median filter.

Returning a list `L`

with `L$y`

the corrected time series and
`L$ind`

the indices of outliers in the ‘median absolut deviation’
sense.

Don't take the expression *outlier* too serious. It's just a hint to
values in the time series that appear to be unusual in the vicinity of
their neighbors under a normal distribution assumption.

Pearson, R. K. (1999). “Data cleaning for dynamic modeling and control”. European Control Conference, ETH Zurich, Switzerland.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 |

pracma documentation built on June 21, 2017, 9:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.