bugGNU Scientific Library - Bugs: bug #58202, Wrong Result Median for...


You are not allowed to post comments on this tracker with your current authentication level.

bug #58202: Wrong Result Median for gsl_rstat_quantile_get with fix

Submitter:  Jonathan Schmalfuß <joscao>
Submitted:  Sat 18 Apr 2020 06:26:00 PM UTC
Category:  Documentation Severity:  3 - Normal
Operating System:  Ubuntu 18.04.4 LTS Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  12.6

Wed 20 Jan 2021 05:43:04 AM UTC, comment #1: 

fixed in commit 42933198abec39071c1ae1bdf2d7e3adeed233a2

Patrick Alken <psa>
Group administrator
Sat 18 Apr 2020 06:26:00 PM UTC, original submission:  

In: rquantile.c

double gsl_rstat_quantile_get(gsl_rstat_quantile_workspace *w)

Check against w->n >= 5, should be check against w->n > 5.

Because first time sorting of underlying data in:
int gsl_rstat_quantile_add(const double x, gsl_rstat_quantile_workspace *w)

happens when n turns 6 and not when n turns 5.

Has slipped through test in Documentation 22.5 Examples.
Median of dataset
17.2, 18.1, 16.5, 18.3, 12.6 = dataset
12.6, 16.5, 17.2, 18.1, 18.3 = ordered dataset
is equal to 17.2 NOT 16.5 as in Documentation.

Jonathan Schmalfuß <joscao>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psa (Posted a comment)
  • -email is unavailable- added by joscao (Submitted the item)

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-20 psa StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code