octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #56572] [octave forge] (statistics) kolmogorov


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #56572] [octave forge] (statistics) kolmogorov_smirnov_test_2(x, y) warns for duplicate values in x and y.
Date: Tue, 2 Jul 2019 06:26:44 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?56572>

                 Summary: [octave forge] (statistics)
kolmogorov_smirnov_test_2(x,y) warns for duplicate values in x and y.
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Tue 02 Jul 2019 12:26:42 PM CEST
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: Any

    _______________________________________________________

Details:

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)





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56572>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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