# Generalized ESD Test for Outlier Detection using Python

The Generalized Extreme Studentized Deviate (ESD) Test is a statistical test for outliers. It is used on univariate data which follows an approximately normal distribution, and can be used to detect one or more outliers.

It is especially useful in situations where the number of outliers is not known: in other outlier tests, like the Grubbs test and the Tietjen Moore test, the number of outliers to be found must be specified beforehand. For the ESD test, you just specify an upper bound for the number of outliers.

We test the null hypothesis that the data has no outliers vs. the alternative hypothesis that there are at most k outliers (for some user specified value of k).

In this video, I’ll walk you through how you can implement the test in Python.

## To view the video

- Click here
- Click on the image below