[Top][All Lists]

[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


                 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



The original problem description is here:


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


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:


  Message sent via Savannah

reply via email to

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