# Aggregations Percentiles ES 6.2.4 VS ES 6.3.2

**URL:** <https://discuss.elastic.co/t/aggregations-percentiles-es-6-2-4-vs-es-6-3-2/155134>\
**Category:** Elasticsearch\
**Created:** [November 2, 2018, 8:43am UTC](https://discuss.elastic.co/t/aggregations-percentiles-es-6-2-4-vs-es-6-3-2/155134 "2018-11-02T08:43:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![p365labs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p365labs/32/13075_2.png) [@p365labs](https://discuss.elastic.co/u/p365labs)\
**Post date:** [November 2, 2018, 8:43am UTC](https://discuss.elastic.co/t/aggregations-percentiles-es-6-2-4-vs-es-6-3-2/155134/1 "2018-11-02T08:43:04Z")

</div>

Hi I have a problems with Percentiles aggregations or better I would like to understand a different behaviour between two different minor versions of Elasticsearch :

Problems : find percentiles of this series (10 elements of integers values):

100,200,300,400,500,600,700,800,900,1000

expected values :  
1st percentile --\> 100.0  
5th percentile --\> 100.0  
25th percentile --\> 300.0  
50th percentile --\> 550.0  
75th percentile --\> 800.0  
95th percentile --\> 1000.0  
99th percentile --\> 1000.0

What happens is that with ES 6.2.4 I have these results

```
    1st percentile --> 109.0
    5th percentile --> 145.0
    25th percentile --> 325.0
    50th percentile --> 550.0
    75th percentile --> 775.0
    95th percentile --> 955.0
    99th percentile --> 991.0

```

What happens is that with ES 6.3.2 I have these results

```
   1st percentile --> 100.0
5th percentile --> 100.0
25th percentile --> 300.0
50th percentile --> 550.0
75th percentile --> 800.0
95th percentile --> 1000.0
99th percentile --> 1000.0

```

I've had a look at the docs, but nothing about minor bc or changes in the algorithm;  
I've had a look at the ES source code, but again, nothing seems to have changed.  
So anyone has an idea of what's happening ?  
Maybe I'm doing something wrong or I forgot the math behind it 😉

Thanks a lot.  
Federico

---

<div class="post-metadata">

**Author:** ![p365labs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p365labs/32/13075_2.png) [@p365labs](https://discuss.elastic.co/u/p365labs)\
**Post date:** [November 5, 2018, 3:24pm UTC](https://discuss.elastic.co/t/aggregations-percentiles-es-6-2-4-vs-es-6-3-2/155134/2 "2018-11-05T15:24:02Z")

</div>

For the people reading this, I've solved and it looks like from ES 6.3.x it has changed the implementation of the T-DIGEST algoriithm from 3.1 to 3.2 version which has a different implementation.  
Have a look at [this PR](https://github.com/elastic/elasticsearch/pull/28305).

I'm considering this closed and solved.

@polyfractal or @javanna wouldn't be interesting updating the doc ? I understand that these are kind of ES internals, but I tried updating Elastica (@ruflin ) to 6.4.x version and all of the tests on Percentiles failed and I didn't know why 🙂

Luckily searching on github allow me to understand why. What do u think ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2018, 3:24pm UTC](https://discuss.elastic.co/t/aggregations-percentiles-es-6-2-4-vs-es-6-3-2/155134/3 "2018-12-03T15:24:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
