Home > freetb4matlab > statistics > tests > kolmogorov_smirnov_test.m

# kolmogorov_smirnov_test

## PURPOSE

% Perform a Kolmogorov-Smirnov test of the null hypothesis that the

## SYNOPSIS

function [pval, ks] = kolmogorov_smirnov_test (x, dist, varargin)

## DESCRIPTION

```% -*- texinfo -*-
% @deftypefn {Function File} {[@var{pval}, @var{ks}] =} kolmogorov_smirnov_test (@var{x}, @var{dist}, @var{params}, @var{alt})
% Perform a Kolmogorov-Smirnov test of the null hypothesis that the
% sample @var{x} comes from the (continuous) distribution dist.  I.e.,
% if F and G are the CDFs corresponding to the sample and dist,
% respectively, then the null is that F == G.
%
% The optional argument @var{params} contains a list of parameters of
% @var{dist}.  For example, to test whether a sample @var{x} comes from
% a uniform distribution on [2,4], use
%
% @example
% kolmogorov_smirnov_test(x, 'uniform', 2, 4)
% @end example
%
% @noindent
% @var{dist} can be any string for which a function @var{dist_cdf}
% that calculates the CDF of distribution @var{dist} exists.
%
% 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}.
%
% 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