{"action":"created","issue":{"url":"https://api.github.com/repos/spenczar/tdigest/issues/9","repository_url":"https://api.github.com/repos/spenczar/tdigest","labels_url":"https://api.github.com/repos/spenczar/tdigest/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/spenczar/tdigest/issues/9/comments","events_url":"https://api.github.com/repos/spenczar/tdigest/issues/9/events","html_url":"https://github.com/spenczar/tdigest/issues/9","id":295278136,"number":9,"title":"Possible bug in quantiles?","user":{"login":"goller","id":1922921,"avatar_url":"https://avatars2.githubusercontent.com/u/1922921?v=4","gravatar_id":"","url":"https://api.github.com/users/goller","html_url":"https://github.com/goller","followers_url":"https://api.github.com/users/goller/followers","following_url":"https://api.github.com/users/goller/following{/other_user}","gists_url":"https://api.github.com/users/goller/gists{/gist_id}","starred_url":"https://api.github.com/users/goller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goller/subscriptions","organizations_url":"https://api.github.com/users/goller/orgs","repos_url":"https://api.github.com/users/goller/repos","events_url":"https://api.github.com/users/goller/events{/privacy}","received_events_url":"https://api.github.com/users/goller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T20:17:43Z","updated_at":"2018-02-07T21:50:03Z","closed_at":null,"author_association":"NONE","body":"Hey there, I'm using \r\n\r\n```go\r\n\ttd := tdigest.NewWithCompression(1000)\r\n\tfor _, x := range []float64{1, 2, 3, 4, 5, 5, 4, 3, 2, 1} {\r\n\t\ttd.Add(x, 1)\r\n\t}\r\n\tfmt.Println(\"Quantile Result\")\r\n\tfor _, q := range []float64{0.1, 0.2, 0.5, 0.75, 0.9, 0.99, 0.999} {\r\n\t\tfmt.Println(q, td.Quantile(q))\r\n\t}\r\n```\r\n\r\nThe results are:\r\n```\r\nQuantile Result\r\n0.1  1\r\n0.2  1.5\r\n0.5  3.071428571428571\r\n0.75 4.142857142857142\r\n0.9  4.785714285714285\r\n0.99 5.171428571428571\r\n0.999 5.209999999999999\r\n```\r\n\r\nHowever, I think the results should be:\r\n\r\n```\r\n0.1  1\r\n0.2  1.5\r\n0.5  3\r\n0.75 4\r\n0.9  5\r\n0.99 5\r\n0.999 5\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spenczar/tdigest/issues/comments/363922485","html_url":"https://github.com/spenczar/tdigest/issues/9#issuecomment-363922485","issue_url":"https://api.github.com/repos/spenczar/tdigest/issues/9","id":363922485,"user":{"login":"spenczar","id":880413,"avatar_url":"https://avatars1.githubusercontent.com/u/880413?v=4","gravatar_id":"","url":"https://api.github.com/users/spenczar","html_url":"https://github.com/spenczar","followers_url":"https://api.github.com/users/spenczar/followers","following_url":"https://api.github.com/users/spenczar/following{/other_user}","gists_url":"https://api.github.com/users/spenczar/gists{/gist_id}","starred_url":"https://api.github.com/users/spenczar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spenczar/subscriptions","organizations_url":"https://api.github.com/users/spenczar/orgs","repos_url":"https://api.github.com/users/spenczar/repos","events_url":"https://api.github.com/users/spenczar/events{/privacy}","received_events_url":"https://api.github.com/users/spenczar/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T21:50:03Z","updated_at":"2018-02-07T21:50:03Z","author_association":"OWNER","body":"Very possible. This implementation uses an old, buggy algorithm from an early version of the t-digest paper; that algorithm suffers instabilities under high compression (see https://github.com/tdunning/t-digest/issues/78). The new \"merging\" t-digest algorithm is supposed to fix this, but I haven't gotten around to implementing it."}}
{"actor":{"display_login":"spenczar"}}