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.

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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 02 Jul 2019 10:26:42 AM UTC, original submission:  

The original problem description is here:


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


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>
Project Member


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

Attach Files:

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 siko1056 (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.5