SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.distribution.kolmogorov
Class KolmogorovTwoSamplesDistribution

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.distribution.kolmogorov.KolmogorovTwoSamplesDistribution
All Implemented Interfaces:
UnivariateDistribution

public class KolmogorovTwoSamplesDistribution
extends java.lang.Object
implements UnivariateDistribution

Compute the p-values for the generalized (conditionally distribution-free) Smirnov homogeneity test.

That is, P(Dm,n ≥ c | H0) = 1 - P(Dm,n < c | H0) = 1 - cdf(c) , where Dm,n max |Sm(x) - Sn(x)|

See Also:

Nested Class Summary
static class KolmogorovTwoSamplesDistribution.Side
          the types of KolmogorovDistribution two-sample test available
 
Field Summary
 int bigN
          the big N for which n > bigN we use the asymptotic distribution
 int n
          the total number of observations of the two samples
 int n1
          the number of observations of the first sample
 int n2
          the number of observations of the second sample
 KolmogorovTwoSamplesDistribution.Side side
          the type of KolmogorovDistribution two-sample distribution, i.e., equal, greater, less
 
Constructor Summary
KolmogorovTwoSamplesDistribution(double[] sample1, double[] sample2, KolmogorovTwoSamplesDistribution.Side side)
          Construct a two-sample KolmogorovDistribution distribution.
KolmogorovTwoSamplesDistribution(int n1, int n2, double[] samples, KolmogorovTwoSamplesDistribution.Side side, int bigN)
          Construct a two-sample KolmogorovDistribution distribution.
KolmogorovTwoSamplesDistribution(int n1, int n2, KolmogorovTwoSamplesDistribution.Side side, double[] samples)
          Construct a two-sample KolmogorovDistribution distribution.
KolmogorovTwoSamplesDistribution(int n1, int n2, KolmogorovTwoSamplesDistribution.Side side, int bigN)
          Construct a two-sample KolmogorovDistribution distribution, assuming that there is no tie in the samples.
 
Method Summary
 double cdf(double x)
          The cumulative distribution function.
 double density(double x)
          Deprecated. Not supported yet.
 double entropy()
          Deprecated. Not supported yet.
 double kurtosis()
          Deprecated. Not supported yet.
 double mean()
          Deprecated. Not supported yet.
 double median()
          Deprecated. Not supported yet.
 double moment(double x)
          Deprecated. Not supported yet.
 double quantile(double q)
          Deprecated. Not supported yet.
 double skew()
          Deprecated. Not supported yet.
 double variance()
          Deprecated. Not supported yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

side

public final KolmogorovTwoSamplesDistribution.Side side
the type of KolmogorovDistribution two-sample distribution, i.e., equal, greater, less


bigN

public final int bigN
the big N for which n > bigN we use the asymptotic distribution


n1

public final int n1
the number of observations of the first sample


n2

public final int n2
the number of observations of the second sample


n

public final int n
the total number of observations of the two samples

Constructor Detail

KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
                                        int n2,
                                        double[] samples,
                                        KolmogorovTwoSamplesDistribution.Side side,
                                        int bigN)
Construct a two-sample KolmogorovDistribution distribution.

Parameters:
n1 - size of sample 1
n2 - size of sample 2
samples - the concatenate of the two samples in ascending order
bigN - when n > bigN, we use the asymptotic distribution

KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
                                        int n2,
                                        KolmogorovTwoSamplesDistribution.Side side,
                                        int bigN)
Construct a two-sample KolmogorovDistribution distribution, assuming that there is no tie in the samples.

Parameters:
n1 - size of sample 1
n2 - size of sample 2
bigN - when n > bigN, we use the asymptotic distribution

KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
                                        int n2,
                                        KolmogorovTwoSamplesDistribution.Side side,
                                        double[] samples)
Construct a two-sample KolmogorovDistribution distribution.

Parameters:
n1 - size of sample 1
n2 - size of sample 2
side - the type of KolmogorovDistribution two-sample test
samples - the concatenate of the two samples in ascending order

KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(double[] sample1,
                                        double[] sample2,
                                        KolmogorovTwoSamplesDistribution.Side side)
Construct a two-sample KolmogorovDistribution distribution.

Parameters:
sample1 - sample 1
sample2 - sample 2
side - the type of KolmogorovDistribution two-sample test
Method Detail

mean

@Deprecated
public double mean()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the mean of this distribution.

Specified by:
mean in interface UnivariateDistribution
Returns:
the mean
See Also:
Wikipedia: Expected value

median

@Deprecated
public double median()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the median of this distribution.

Specified by:
median in interface UnivariateDistribution
Returns:
the median
See Also:
Wikipedia: Median

variance

@Deprecated
public double variance()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the variance of this distribution.

Specified by:
variance in interface UnivariateDistribution
Returns:
the variance
See Also:
Wikipedia: Variance

skew

@Deprecated
public double skew()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the skewness of this distribution.

Specified by:
skew in interface UnivariateDistribution
Returns:
the skewness
See Also:
Wikipedia: Skewness

kurtosis

@Deprecated
public double kurtosis()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the excess kurtosis of this distribution.

Specified by:
kurtosis in interface UnivariateDistribution
Returns:
the excess kurtosis
See Also:
Wikipedia: Kurtosis

entropy

@Deprecated
public double entropy()
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
Get the entropy of this distribution.

Specified by:
entropy in interface UnivariateDistribution
Returns:
the entropy
See Also:
Wikipedia: Entropy (information theory)

cdf

public double cdf(double x)
Description copied from interface: UnivariateDistribution
The cumulative distribution function.
F(x) = Pr(X <= x)

Specified by:
cdf in interface UnivariateDistribution
Parameters:
x - x
Returns:
F(x) = Pr(X <= x)
See Also:
Wikipedia: Cumulative distribution function

quantile

@Deprecated
public double quantile(double q)
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
The inverse of the cumulative distribution function. It returns the value below which random draws from the given distribution would fall, u×100 percent of the time.
F-1(u) = x, such that Pr(X <= x) = u

This may not always exist.

Specified by:
quantile in interface UnivariateDistribution
Parameters:
q - u
Returns:
F-1(u)
See Also:
Wikipedia: Quantile function

density

@Deprecated
public double density(double x)
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
The density function, which, if exists, is the derivative of F. It describes the density of probability at each point in the sample space.
f(x) = dF(X) / dx

This may not always exist. For the discrete cases, this is the probability mass function. It gives the probability that a discrete random variable is exactly equal to some value.

Specified by:
density in interface UnivariateDistribution
Parameters:
x - x
Returns:
F(x) = Pr(X <= x)
See Also:

moment

@Deprecated
public double moment(double x)
Deprecated. Not supported yet.

Description copied from interface: UnivariateDistribution
The moment generating function, which is the expected value of
etX

This may not always exist.

Specified by:
moment in interface UnivariateDistribution
Parameters:
x - x
Returns:
E(exp(tX))
See Also:
Wikipedia: Moment-generating function

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.