Why can a quartile lie between observed values?
quantile estimates a requested rank from sorted observations. The default linear method interpolates between neighboring ranks.
numpy.quantile in practice
The lower quartile of 0,10,20,30 is 7.5 with linear interpolation. Check estimator conventions before comparing monitoring systems, especially for small samples.
import numpy as np
np.quantile([0,10,20,30],0.25,method='linear')Result 7.5
中文
为什么四个观测的四分位数可能落在观测之间?
quantile 按指定分位位置和估计方法从有序样本求值。默认线性方法在相邻秩之间插值。
numpy.quantile 算例
样本 0、10、20、30 的 25% 分位数为 7.5。比较两个监控系统之前要核对分位估计方法,尤其在小样本时。
import numpy as np
np.quantile([0,10,20,30],0.25,method='linear')结果 7.5