Two-sided MedianΒΆ

Two-sided Median algorithm computes the median

\[m_n^k = \text{Median}\{Y_{n-k}, \ldots, Y_{n-1}, Y_{n+1}, \ldots, Y_{n+k} \}.\]

\(Y_n\) is the observed point and \(2k\) is the size of the neighborhood window. If

\[|m_n^k - Y_n| \geq \tau \, \text{,}\]

\(Y_n\) is treated as a value outside the region of interest.

Input Parameters

Parameter Type Constraint Description Remarks
\(Y\) \(Y \in \mathbb R^N\) \(N \in \mathbb{N}, N \geq 3\) Input data vector of length \(N\) None
\(\tau\) \(\tau \in \mathbb R^+\) None User-specified threshold None

Output Parameters

Parameter Type Constraint Description Remarks
\(\hat{Y}\) \(\hat{Y} \in \mathbb R^N\) None Values in the \(Y\) list which are outside the region of interest are marked None

Single Steps using the Algorithm

References

    1. Basu, M. Meckesheimer, Automatic outlier detection for time series: an application to sensor data, Knowledge and Information Systems, vol. 11, Issue 2, pp 137-154, 2007.