Kstest and Logdecay: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
No edit summary
 
imported>Jeremy
(Importing text file)
 
Line 1: Line 1:
===Purpose===
===Purpose===


Kolmogorov-Smirnov test that a sample has a specified distribution.
Variance scales a matrix using the log decay of the variable axis.


===Synopsis===
===Synopsis===


:vals = kstest(x,distname)
:[sx,logscl] = logdecay(x,tau)  
 
====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'.  
Inputs are data to be scaled (x), and the decay rate (tau). Outputs are the variance scaled matrix (sx) and the log decay based variance scaling parameters (logscl).


====Outputs====
For an m x n matrix 'x' the variance scaling used for variable 'i' is exp(-(i-1)/((n-1)\*tau)). This gives a scaling of 1 on the first variable (i.e. no scaling), and a scaling of 1/exp(-1/tau) on the last variable. The following table gives example values of tau and the scaling on the last variable:


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.
: tau    scaling


* '''Ks''' =  value of the adjusted test statistic.
:  1      2.7183


* '''Dn''' = unadjusted test statistic.
:  1/2    7.3891


* '''parameters''' = maximum likelihood estimates.
:  1/3    20.0855


===Examples===
:  1/4    54.5982


   kstest(x)
:  1/5   148.4132
  kstest(x,'exp')


===See Also===
===See Also===


[[chitest]], [[distfit]]
[[autoscale]], [[scale]]

Revision as of 15:25, 3 September 2008

Purpose

Variance scales a matrix using the log decay of the variable axis.

Synopsis

[sx,logscl] = logdecay(x,tau)

Description

Inputs are data to be scaled (x), and the decay rate (tau). Outputs are the variance scaled matrix (sx) and the log decay based variance scaling parameters (logscl).

For an m x n matrix 'x' the variance scaling used for variable 'i' is exp(-(i-1)/((n-1)\*tau)). This gives a scaling of 1 on the first variable (i.e. no scaling), and a scaling of 1/exp(-1/tau) on the last variable. The following table gives example values of tau and the scaling on the last variable:

tau scaling
1 2.7183
1/2 7.3891
1/3 20.0855
1/4 54.5982
1/5 148.4132

See Also

autoscale, scale