SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.rank.wilcoxon
Class WilcoxonRankSumDistribution

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.rank.wilcoxon.WilcoxonRankSumDistribution
All Implemented Interfaces:
UnivariateDistribution

public class WilcoxonRankSumDistribution
extends java.lang.Object
implements UnivariateDistribution

Compute the exact distribution of the Wilcoxon rank sum test statistic.

Let x and y be two random, independent samples of size M and N. The Wilcoxon rank sum statistic is the number of all pairs (x[i], y[j]) for which y[j] is not greater than x[i]. This statistic takes values between 0 and M * N.

The R equivalent functions are dwilcox, pwilcox, qwilcox, rwilcox.

See Also:
"Zbynek Sidak, Pranab K. Sen, Jaroslav Hajek. Theory of Rank Tests. Theorems 1, Section 5.3, p.173."

Field Summary
 int M
          number of observations in group 1
 int N
          number of observations in group 2
 
Constructor Summary
WilcoxonRankSumDistribution(int M, int N)
          Construct a Wilcoxon Rank Sum distribution for sample sizes M and N.
 
Method Summary
 double cdf(double x)
          The cumulative distribution function.
 double density(double x)
          The density function, which, if exists, is the derivative of F.
 double entropy()
          Deprecated. Not supported yet.
 double kurtosis()
          Deprecated. Not supported yet.
 double mean()
          Get the mean of this distribution.
 double median()
          Deprecated. Not supported yet.
 double moment(double x)
          Deprecated. Not supported yet.
 double pValue(double x)
          Compute the two-sided p-value for a critical value.
 double pValue1SidedGreater(double x)
          Compute the one-sided p-value for the statistics greater than a critical value.
 double quantile(double u)
          The inverse of the cumulative distribution function.
 double skew()
          Deprecated. Not supported yet.
 double variance()
          Get the variance of this distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M

public final int M
number of observations in group 1


N

public final int N
number of observations in group 2

Constructor Detail

WilcoxonRankSumDistribution

public WilcoxonRankSumDistribution(int M,
                                   int N)
Construct a Wilcoxon Rank Sum distribution for sample sizes M and N.

Parameters:
M - number of observations in group 1
N - number of observations in group 2
Method Detail

mean

public double mean()
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

public double variance()
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

public double quantile(double u)
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:
u - u
Returns:
F-1(u)
See Also:
Wikipedia: Quantile function

density

public double density(double x)
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

pValue1SidedGreater

public double pValue1SidedGreater(double x)
Compute the one-sided p-value for the statistics greater than a critical value.

Parameters:
x - a critical value
Returns:
the one-sided p-value

pValue

public double pValue(double x)
Compute the two-sided p-value for a critical value.

Parameters:
x - a critical value
Returns:
the two-sided p-value

SuanShu, a Java numerical and statistical library

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