Get 40% Off
🚨 Volatile Markets? Find Hidden Gems for Serious Outperformance
Find Stocks Now

Outlier Risk, Part III

Published 12/18/2021, 11:43 PM
Updated 07/09/2023, 06:31 AM

In the first two previous articles in this series (see here and here), we reviewed basic applications for identifying outliers in a data set—a crucial task for analyzing financial and economic time series.

Let’s push on and kick the tires on another tool: the Hampel filter, another methodology to identify extremes values in a data set.

The key feature here is the use of median absolute deviation for quantifying variability. We’ll use prices for the US stock market (S&P 500 Index) starting in 2010 as a test, based on a rolling window of three months (60 trading days). The threshold, which determines sensitivity for identifying outliers, is set to 2.

Running the numbers on this basis identifies several instances of extreme outliers (red dots in the chart below). The most recent: the coronavirus crash in March 2020.

S&P 500 - Hampel Filter Outliers

One of advantage of the Hampel filter is its flexibility. By adjusting the two parameters—trailing window and the threshold—it’s easy to customize the search for outliers so as to match the research objective and data set’s unique features.

It’s easy to dismiss this type of analysis when looking at the S&P 500 data. Casual observation of the time series suggests that the outliers are conspicuous. Perhaps, but looking at rolling performance data can mask outliers via visual inspection. Also, less-familiar markets and economic time series can be more challenging for intuitively detecting outliers. That’s especially true if the task is to automatically identify and replace outliers in a large data set for a particular modeling exercise.

3rd party Ad. Not an offer or recommendation by Investing.com. See disclosure here or remove ads .

There are several alternatives to a Hampel filter for robust, flexible tools to detect extreme data points. In upcoming articles we’ll explore some of the possibilities. Ideally, several filters are applied in the search of outliers in the interest of developing deeply robust results.

Conceptually speaking, there is universal agreement on the case for profiling radical values in a data set. The specifics, however, can get murky, particularly if you’re relying on qualitative judgment. That’s a sign that it’s time to roll out quantitative analysis. In the cause of detecting outliers, the Hampel filter is an obvious choice, but it’s far from the only choice.

Latest comments

Risk Disclosure: Trading in financial instruments and/or cryptocurrencies involves high risks including the risk of losing some, or all, of your investment amount, and may not be suitable for all investors. Prices of cryptocurrencies are extremely volatile and may be affected by external factors such as financial, regulatory or political events. Trading on margin increases the financial risks.
Before deciding to trade in financial instrument or cryptocurrencies you should be fully informed of the risks and costs associated with trading the financial markets, carefully consider your investment objectives, level of experience, and risk appetite, and seek professional advice where needed.
Fusion Media would like to remind you that the data contained in this website is not necessarily real-time nor accurate. The data and prices on the website are not necessarily provided by any market or exchange, but may be provided by market makers, and so prices may not be accurate and may differ from the actual price at any given market, meaning prices are indicative and not appropriate for trading purposes. Fusion Media and any provider of the data contained in this website will not accept liability for any loss or damage as a result of your trading, or your reliance on the information contained within this website.
It is prohibited to use, store, reproduce, display, modify, transmit or distribute the data contained in this website without the explicit prior written permission of Fusion Media and/or the data provider. All intellectual property rights are reserved by the providers and/or the exchange providing the data contained in this website.
Fusion Media may be compensated by the advertisers that appear on the website, based on your interaction with the advertisements or advertisers.
© 2007-2024 - Fusion Media Limited. All Rights Reserved.