[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #58202] Wrong Result Median for gsl_rstat_quantile_get with fix

From: Jonathan Schmalfuß
Subject: [bug #58202] Wrong Result Median for gsl_rstat_quantile_get with fix
Date: Sat, 18 Apr 2020 14:26:02 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0


                 Summary: Wrong Result Median for gsl_rstat_quantile_get with
                 Project: GNU Scientific Library
            Submitted by: joscao
            Submitted on: Sat 18 Apr 2020 06:26:00 PM UTC
                Category: Documentation
                Severity: 3 - Normal
        Operating System: Ubuntu 18.04.4 LTS
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 12.6
         Discussion Lock: Any



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.


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]