Kstest: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Kolmogorov-Smirnov test that a sample has a specified distribution.
Kolmogorov-Smirnov test that a sample has a specified distribution.
===Synopsis===
===Synopsis===
:vals = kstest(x,distname)
:vals = kstest(x,distname)
INPUTS:
 
* x = matrix (column vector) in which the sample data is stored.
===Description===
*  distname = string, optional distribution name to assume as the parent distribution for the sample. Default value is 'normal'.  
 
OUTPUTS:
Performs a Kolmogorov-Smirnov test on a set of values to determine if they came from a specified distribution.
The return value is a structure with fields (larger values indicate rejecting the named distribution as a candidate parent distribution for the sample). The ks is the value of the Kolmogorov-Smirnov statistic and is   times the maximum difference of the distributions. The maximum difference in the distributions is returned as Dn.
 
* Ks =  value of the adjusted test statistic.
====Inputs====
* Dn = unadjusted test statistic.
 
* parameters = maximum likelihood estimates.
* '''x''' = matrix (column vector) in which the sample data is stored.
 
'''distname''' = string, optional distribution name to assume as the parent distribution for the sample. Default value is 'normal'.  
 
====Outputs====
 
The return value is a structure with fields (larger values indicate rejecting the named distribution as a candidate parent distribution for the sample). The ks is the value of the Kolmogorov-Smirnov statistic and is <math>\sqrt[ ]{ n }</math> times the maximum difference of the distributions. The maximum difference in the distributions is returned as Dn.
 
* '''Ks''' =  value of the adjusted test statistic.
 
* '''Dn''' = unadjusted test statistic.
 
* '''parameters''' = maximum likelihood estimates.
 
===Examples===
===Examples===
kstest(x)
 
kstest(x,'exp')
  kstest(x)
  kstest(x,'exp')
 
===See Also===
===See Also===
[[CHITEST]], [[DISTFIT]]
 
[[chitest]], [[distfit]]

Latest revision as of 08:18, 4 September 2008

Purpose

Kolmogorov-Smirnov test that a sample has a specified distribution.

Synopsis

vals = kstest(x,distname)

Description

Performs a Kolmogorov-Smirnov test on a set of values to determine if they came from a specified distribution.

Inputs

  • x = matrix (column vector) in which the sample data is stored.
  • distname = string, optional distribution name to assume as the parent distribution for the sample. Default value is 'normal'.

Outputs

The return value is a structure with fields (larger values indicate rejecting the named distribution as a candidate parent distribution for the sample). The ks is the value of the Kolmogorov-Smirnov statistic and is times the maximum difference of the distributions. The maximum difference in the distributions is returned as Dn.

  • Ks = value of the adjusted test statistic.
  • Dn = unadjusted test statistic.
  • parameters = maximum likelihood estimates.

Examples

 kstest(x)
 kstest(x,'exp')

See Also

chitest, distfit