Home > freetb4matlab > statistics > tests > kolmogorov_smirnov_test_2.m

kolmogorov_smirnov_test_2

PURPOSE ^

% Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis

SYNOPSIS ^

function [pval, ks, d] = kolmogorov_smirnov_test_2 (x, y, alt)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {[@var{pval}, @var{ks}, @var{d}] =} kolmogorov_smirnov_test_2 (@var{x}, @var{y}, @var{alt})
% Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis
% that the samples @var{x} and @var{y} come from the same (continuous)
% distribution.  I.e., if F and G are the CDFs corresponding to the
% @var{x} and @var{y} samples, respectively, then the null is that F ==
% G.
%
% With the optional argument string @var{alt}, the alternative of
% interest can be selected.  If @var{alt} is @code{'~='} or
% @code{'<>'}, the null is tested against the two-sided alternative F
% ~= G.  In this case, the test statistic @var{ks} follows a two-sided
% Kolmogorov-Smirnov distribution.  If @var{alt} is @code{'>'}, the
% one-sided alternative F > G is considered.  Similarly for @code{'<'},
% the one-sided alternative F < G is considered.  In this case, the
% test statistic @var{ks} has a one-sided Kolmogorov-Smirnov
% distribution.  The default is the two-sided case.
%
% The p-value of the test is returned in @var{pval}.
%
% The third returned value, @var{d}, is the test statistic, the maximum
% vertical distance between the two cumulative distribution functions.
%
% If no output argument is given, the p-value is displayed.
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003