Quantiles
Formal Definition
The \(\alpha^{\rm{th}}\) quantile is defined as the point \(x_{\alpha}\) in distribution for which the CDF of the distribution equals to \(\alpha\). \( F(x_{\alpha}) = \alpha \)
The percentile is the quantile experessed as a precent.
The median is the \(0.5^{\rm{th}}\) quantile or \(50^{\rm{th}}\) percentile.
Note that the quantile here is the property of the probability distribution, not the sampled data points. To distinguish between this and the sample quantile, we may call the quantile defined here as the population quantile.
Quantiles of the Standard Normal Distribution
In the following chart, the \(0.85\) quantile or \(85\) percentile of the standard normal distribution is illustrated.
In Code
In python, we can use the ppf method of PDFs of scipy.stats module to calculate quantiles of probability distribution.s In the following code, we use scipy.stats.norm.ppf to find the given quantiles of standard normal distribution. Can you guess what are loc and scale parameters in this code?
import numpy as np
from scipy.stats import norm
# find percentiles of standard normal distribution
norm.ppf([0.001, 0.0456, 0.16, 0.5, 0.84, 0.954, 0.999], loc=0, scale=1)
# the quantiles will be calculated as follows
# array([-3.09023231, -1.6891014 , -0.99445788, 0. , 0.99445788, 1.68494077, 3.09023231])