Difference between ECDF(Empirical Cumulative Distribution Function) and CDF:
The empirical CDF is built from an actual data set . The CDF is a theoretical construct.
Let X be a random variable.
- The cumulative distribution function F(x) gives the P(X≤x) .
- An empirical CDF function G(x) gives the P(X≤x) in your actual sample.
The distinction is which probability measure is used. For the ECDF, you use the probability measure implicitly defined by the frequency counts in your sample.
Simple example (coin flip):
Let X be a random variable denoting the result of a single coin flip where X=1 denotes heads and X=0 denotes tails.
The CDF for a fair coin is given by:
If you flipped 2 heads and 1 tail, the empirical CDF would be:
The empirical CDF would reflect that 2/3 of your flips were heads.
Why ECDF is useful?
- 1st step for data visualization. Usually along with Histogram;
- Help us to define the distribution of dataset;