Method ao/kstest


  KSTEST perform KS test on input AOs
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  DESCRIPTION: Kolmogorov - Smirnov test is typically used to assess if a
  sample comes from a specific distribution or if two data samples came
  from the same distribution. The test statistics is d_K = max|S(x) - K(x)|
  where S(x) and K(x) are cumulative distribution functions of the two
  inputs respectively.
  In the case of the test on a single data series:
  - null hypothesis is that the data are a realizations of a random variable
    which is distributed according to the given probability distribution
  In the case of the test on two data series:
  - null hypothesis is that the two data series are realizations of the same random variable
 
  CALL:         b = kstest(a1, pl)
                b = kstest(a1, a2, pl)
                b = kstest(a1, a2, a3, pl)
  
  INPUT:        ai: are real valued AO
  
  OUTPUT:       b: are cdata AOs containing the results of the test: 
                  true  if the null hypothesis is rejected
                        at the given significance level.
                  false if the null hypothesis is not rejected
                        at the given significance level.
  The procinfo of b contain further information as:
                  - KSstatistic, the value of d_K = max|S(x) - K(x)|.
                  - criticalValue, it is the value of the test statistics
                  corresponding to the significance level. CRITICAL VALUE
                  is depending on K, where K is the data length of Y1 if Y2
                  is a theoretical distribution, otherwise if Y1 and Y2 are
                  two data samples K = n1*n2/(n1 + n2) where n1 and n2 are
                  data length of Y1 and Y2  respectively. In the case of
                  comparison of a data series with a theoretical
                  distribution and the data series is composed of
                  correlated  elements. K can be adjusted with a shape
                  parameter in order to recover test fairness. In such a
                  case the test is performed for K' = Phi * K. If
                  KSstatistic > criticalValue the null hypothesis is 
                  rejected.
 
 
  Parameters Description
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Method Details
Access public
Defining Class ao
Sealed 0
Static 0

Parameter Description

empirical

no description
Key Default Value Options Description
kstest
TESTDISTRIBUTION 'EMPIRICAL'
  • 'EMPIRICAL'
  • 'NORMAL'
  • 'CHI2'
  • 'F'
  • 'GAMMA'
test data are compared with the given test distribution. Available choices are:
  1. EMPIRICAL test all the input objects (starting from the second) against the first object.
  2. NORMAL test all the input objects against the Normal distribution, with mean specified by the 'MEAN' parameter, and sigma specified by the 'STD' parameter
  3. CHI2 test all the input objects against the Chi square distribution, with degrees of freedom specified by the 'DOF' parameter
  4. F test all the input objects against the F distribution, with first degree of freedom specified by the 'DOF1' parameter, and second degree of freedom specified by the 'DOF2' parameter
  5. GAMMA test all the input objects against the Gamma distribution, with shape parameter (k) specified by the 'SHAPE' parameter, and scale parameter (theta) specified by the 'SCALE' parameter
ALPHA 0.050000000000000003 none ALPHA is the desired significance level. It represents the probability of rejecting the null hypothesis when it is true.Rejecting the null hypothesis, H0, when it is true is called a Type I Error. Therefore, if the null hypothesis is true , the level of the test, is the probability of a type I error.
SHAPEPARAM 1 none In the case of comparison of a data series with a theoretical distribution and the data series is composed of correlated elements. K can be adjusted with a shape parameter in order to recover test fairness [3]. In such a case the test is performed for K* = Phi * K.
Phi is the corresponding Shape parameter. The shape parameter depends on the correlations and on the significance value. It does not depend on data length.
CRITICALVALUE [] none In case the critical value for the test is available from external calculations, e.g. Monte Carlo simulation, the vale can be input as a parameter.

Example

plist('TESTDISTRIBUTION', 'EMPIRICAL', 'ALPHA', [0.050000000000000003], 'SHAPEPARAM', [1], 'CRITICALVALUE', [[]])

back to top back to top

normal

no description
Key Default Value Options Description
kstest
TESTDISTRIBUTION 'EMPIRICAL'
  • 'EMPIRICAL'
  • 'NORMAL'
  • 'CHI2'
  • 'F'
  • 'GAMMA'
test data are compared with the given test distribution. Available choices are:
  1. EMPIRICAL test all the input objects (starting from the second) against the first object.
  2. NORMAL test all the input objects against the Normal distribution, with mean specified by the 'MEAN' parameter, and sigma specified by the 'STD' parameter
  3. CHI2 test all the input objects against the Chi square distribution, with degrees of freedom specified by the 'DOF' parameter
  4. F test all the input objects against the F distribution, with first degree of freedom specified by the 'DOF1' parameter, and second degree of freedom specified by the 'DOF2' parameter
  5. GAMMA test all the input objects against the Gamma distribution, with shape parameter (k) specified by the 'SHAPE' parameter, and scale parameter (theta) specified by the 'SCALE' parameter
ALPHA 0.050000000000000003 none ALPHA is the desired significance level. It represents the probability of rejecting the null hypothesis when it is true.Rejecting the null hypothesis, H0, when it is true is called a Type I Error. Therefore, if the null hypothesis is true , the level of the test, is the probability of a type I error.
SHAPEPARAM 1 none In the case of comparison of a data series with a theoretical distribution and the data series is composed of correlated elements. K can be adjusted with a shape parameter in order to recover test fairness [3]. In such a case the test is performed for K* = Phi * K.
Phi is the corresponding Shape parameter. The shape parameter depends on the correlations and on the significance value. It does not depend on data length.
CRITICALVALUE [] none In case the critical value for the test is available from external calculations, e.g. Monte Carlo simulation, the vale can be input as a parameter.
MEAN 0 none The mean of the normal distribution
STD 1 none The standard deviation of the normal distribution

Example

plist('TESTDISTRIBUTION', 'EMPIRICAL', 'ALPHA', [0.050000000000000003], 'SHAPEPARAM', [1], 'CRITICALVALUE', [[]], 'MEAN', [0], 'STD', [1])

back to top back to top

chi2

no description
Key Default Value Options Description
kstest
TESTDISTRIBUTION 'EMPIRICAL'
  • 'EMPIRICAL'
  • 'NORMAL'
  • 'CHI2'
  • 'F'
  • 'GAMMA'
test data are compared with the given test distribution. Available choices are:
  1. EMPIRICAL test all the input objects (starting from the second) against the first object.
  2. NORMAL test all the input objects against the Normal distribution, with mean specified by the 'MEAN' parameter, and sigma specified by the 'STD' parameter
  3. CHI2 test all the input objects against the Chi square distribution, with degrees of freedom specified by the 'DOF' parameter
  4. F test all the input objects against the F distribution, with first degree of freedom specified by the 'DOF1' parameter, and second degree of freedom specified by the 'DOF2' parameter
  5. GAMMA test all the input objects against the Gamma distribution, with shape parameter (k) specified by the 'SHAPE' parameter, and scale parameter (theta) specified by the 'SCALE' parameter
ALPHA 0.050000000000000003 none ALPHA is the desired significance level. It represents the probability of rejecting the null hypothesis when it is true.Rejecting the null hypothesis, H0, when it is true is called a Type I Error. Therefore, if the null hypothesis is true , the level of the test, is the probability of a type I error.
SHAPEPARAM 1 none In the case of comparison of a data series with a theoretical distribution and the data series is composed of correlated elements. K can be adjusted with a shape parameter in order to recover test fairness [3]. In such a case the test is performed for K* = Phi * K.
Phi is the corresponding Shape parameter. The shape parameter depends on the correlations and on the significance value. It does not depend on data length.
CRITICALVALUE [] none In case the critical value for the test is available from external calculations, e.g. Monte Carlo simulation, the vale can be input as a parameter.
DOF 2 none Degrees of freedom of the Chi square distribution

Example

plist('TESTDISTRIBUTION', 'EMPIRICAL', 'ALPHA', [0.050000000000000003], 'SHAPEPARAM', [1], 'CRITICALVALUE', [[]], 'DOF', [2])

back to top back to top

f

no description
Key Default Value Options Description
kstest
TESTDISTRIBUTION 'EMPIRICAL'
  • 'EMPIRICAL'
  • 'NORMAL'
  • 'CHI2'
  • 'F'
  • 'GAMMA'
test data are compared with the given test distribution. Available choices are:
  1. EMPIRICAL test all the input objects (starting from the second) against the first object.
  2. NORMAL test all the input objects against the Normal distribution, with mean specified by the 'MEAN' parameter, and sigma specified by the 'STD' parameter
  3. CHI2 test all the input objects against the Chi square distribution, with degrees of freedom specified by the 'DOF' parameter
  4. F test all the input objects against the F distribution, with first degree of freedom specified by the 'DOF1' parameter, and second degree of freedom specified by the 'DOF2' parameter
  5. GAMMA test all the input objects against the Gamma distribution, with shape parameter (k) specified by the 'SHAPE' parameter, and scale parameter (theta) specified by the 'SCALE' parameter
ALPHA 0.050000000000000003 none ALPHA is the desired significance level. It represents the probability of rejecting the null hypothesis when it is true.Rejecting the null hypothesis, H0, when it is true is called a Type I Error. Therefore, if the null hypothesis is true , the level of the test, is the probability of a type I error.
SHAPEPARAM 1 none In the case of comparison of a data series with a theoretical distribution and the data series is composed of correlated elements. K can be adjusted with a shape parameter in order to recover test fairness [3]. In such a case the test is performed for K* = Phi * K.
Phi is the corresponding Shape parameter. The shape parameter depends on the correlations and on the significance value. It does not depend on data length.
CRITICALVALUE [] none In case the critical value for the test is available from external calculations, e.g. Monte Carlo simulation, the vale can be input as a parameter.
DOF1 2 none First degree of freedom of the F distribution
DOF2 2 none Second degree of freedom of the F distribution

Example

plist('TESTDISTRIBUTION', 'EMPIRICAL', 'ALPHA', [0.050000000000000003], 'SHAPEPARAM', [1], 'CRITICALVALUE', [[]], 'DOF1', [2], 'DOF2', [2])

back to top back to top

gamma

no description
Key Default Value Options Description
kstest
TESTDISTRIBUTION 'EMPIRICAL'
  • 'EMPIRICAL'
  • 'NORMAL'
  • 'CHI2'
  • 'F'
  • 'GAMMA'
test data are compared with the given test distribution. Available choices are:
  1. EMPIRICAL test all the input objects (starting from the second) against the first object.
  2. NORMAL test all the input objects against the Normal distribution, with mean specified by the 'MEAN' parameter, and sigma specified by the 'STD' parameter
  3. CHI2 test all the input objects against the Chi square distribution, with degrees of freedom specified by the 'DOF' parameter
  4. F test all the input objects against the F distribution, with first degree of freedom specified by the 'DOF1' parameter, and second degree of freedom specified by the 'DOF2' parameter
  5. GAMMA test all the input objects against the Gamma distribution, with shape parameter (k) specified by the 'SHAPE' parameter, and scale parameter (theta) specified by the 'SCALE' parameter
ALPHA 0.050000000000000003 none ALPHA is the desired significance level. It represents the probability of rejecting the null hypothesis when it is true.Rejecting the null hypothesis, H0, when it is true is called a Type I Error. Therefore, if the null hypothesis is true , the level of the test, is the probability of a type I error.
SHAPEPARAM 1 none In the case of comparison of a data series with a theoretical distribution and the data series is composed of correlated elements. K can be adjusted with a shape parameter in order to recover test fairness [3]. In such a case the test is performed for K* = Phi * K.
Phi is the corresponding Shape parameter. The shape parameter depends on the correlations and on the significance value. It does not depend on data length.
CRITICALVALUE [] none In case the critical value for the test is available from external calculations, e.g. Monte Carlo simulation, the vale can be input as a parameter.
SHAPE 2 none Shape parameter (k) of the Gamma distribution
SCALE 2 none Scale parameter (theta) of the Gamma distribution

Example

plist('TESTDISTRIBUTION', 'EMPIRICAL', 'ALPHA', [0.050000000000000003], 'SHAPEPARAM', [1], 'CRITICALVALUE', [[]], 'SHAPE', [2], 'SCALE', [2])

back to top back to top

Some information of the method ao/kstest are listed below:
Class name ao
Method name kstest
Category Signal Processing
Package name ltpda
VCS Version 967b0eec0dece803a81af8ef54ad2f8c784b20b2
Min input args 1
Max input args -1
Min output args 1
Max output args -1
Can be used as modifier 1
Supported numeric types {'double'}




©LTP Team