Felix>I wonder if we should change our implementation at all. So do I. I wish JMeter would just throw an error when user tries to calculate 90% percentile out of 5 values =)
Felix>Note I share your thoughts on using a dedicated library but Felix> commons-math may be overkill in terms of performance compared to Felix> HdrHistogram I agree HdrHistogram might be the only way to compute high percentiles with sane amount of memory. Felix>R and numpy will interpolate the median and the percentiles/quantiles. Technically speaking, R has 9 types of quantile calculation: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/quantile.html There's a comment: R.quantile.doc>Further details are provided in Hyndman and Fan (1996) who recommended type 8. The default method is type 7, as used by S and by R < 2.0.0. As far as I understand that, "type 8" is somewhat better, however R defaults to type 7 for backward compatibility reasons. Here's what R version 3.4.0 (2017-04-21) produces: quantile(c(15, 20, 35, 40, 50), c(0.05, 0.3, 0.4, 0.5, 1.0)) 5% 30% 40% 50% 100% 16 23 29 35 50 quantile(c(15, 20, 35, 40, 50), c(0.05, 0.3, 0.4, 0.5, 1.0), type=8) 5% 30% 40% 50% 100% 15.00000 19.66667 27.00000 35.00000 50.00000 Vladimir