bugGNU Octave - Bugs: bug #56572, [octave forge] (statistics)...

 
 

bug #56572: [octave forge] (statistics) kolmogorov_smirnov_test_2(x,y) warns for duplicate values in x and y.

Submitter:  Kai Torben Ohlhus <siko1056>
Submitted:  Tue 02 Jul 2019 10:26:42 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 14 Aug 2022 10:57:36 AM UTC, comment #1: 

A new implementation of the kstest2 function has been pushed at https://github.com/gnu-octave/statistics/commit/8fceee4b029b390a2035074707bc1f686bde5520.

The old kolmogorov_smirnov_test_2 function has been removed from the statistics package. This can be closed.

Andreas Bertsatos <pr0m1th3as>
Tue 02 Jul 2019 10:26:42 AM UTC, original submission:  

The original problem description is here:

https://lists.gnu.org/archive/html/help-octave/2019-06/msg00105.html

The docstring did not change since moving the function to the statistics package:

https://octave.sourceforge.io/statistics/function/kolmogorov_smirnov_test_2.html

Some example to examine the problem:


pkg load statistics

## Create random vectors
rand ("seed", 0);
d1 = rand (100, 1);
d2 = rand (100, 1);

x = 0:0.05:1;

## Create cdfs to visualize kolmogorov_smirnov_test results
d1_cdf = empirical_cdf (x, d1);
d2_cdf = empirical_cdf (x, d2);

## Plot cdfs
figure (1);
plot (x, d1_cdf, '-', x, d2_cdf, '-');

## Run KS-test
disp ('first test without duplicate does not produce warning:');
P = kolmogorov_smirnov_test_2 (d1, d2)

## Add duplicate value to vectors then re-run test
disp ('second test containing duplicate produces warning:');
d1(end + 1) = 0.5;
d2(end + 1) = 0.5;

P = kolmogorov_smirnov_test_2 (d1, d2)

## Attempt to use cdfs instead of raw data as specified in help info
disp ('using cdf produces warning and incorrect results:');
P = kolmogorov_smirnov_test_2 (d1_cdf, d2_cdf)


Kai Torben Ohlhus <siko1056>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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 nrjank (Updated the item)
  • -email is unavailable- added by pr0m1th3as (Posted a comment)
  • -email is unavailable- added by siko1056 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-08-15 nrjank StatusConfirmed Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code