FREQUENCIES: Fix percentiles calculation.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 12 Mar 2011 06:10:54 +0000 (22:10 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 12 Mar 2011 06:10:54 +0000 (22:10 -0800)
commit26ff6fce95fb38f0986017dd922c36d4b1b239c7
tree15c873a4537dc8fdc09f3a11eceb0e12b85fae22
parent12212dfd8afc14405274703b511c32d362ec0ab5
FREQUENCIES: Fix percentiles calculation.

The condition for using a variate directly instead of interpolating was
just wrong.  It would interpolate in cases where it clearly should not,
which produced incorrect results in many cases.

Thanks to Fabio Bordignon <bordignon@demos.it> for reporting the problem
and supplying a simple test case.
src/language/stats/frequencies.q
tests/language/dictionary/weight.at
tests/language/stats/frequencies.at