Click or drag to resize
Accord.NET (logo) MannWhitneyDistribution Class
Mann-Whitney's U statistic distribution.
Inheritance Hierarchy
SystemObject
  Accord.Statistics.DistributionsDistributionBase
    Accord.Statistics.Distributions.UnivariateUnivariateContinuousDistribution
      Accord.Statistics.Distributions.UnivariateMannWhitneyDistribution

Namespace:  Accord.Statistics.Distributions.Univariate
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.4.0
Syntax
[SerializableAttribute]
public class MannWhitneyDistribution : UnivariateContinuousDistribution
Request Example View Source

The MannWhitneyDistribution type exposes the following members.

Constructors
  NameDescription
Public methodMannWhitneyDistribution
Constructs a Mann-Whitney's U-statistic distribution.
Top
Properties
  NameDescription
Public propertyEntropy
This method is not supported.
(Overrides UnivariateContinuousDistributionEntropy.)
Public propertyMean
Gets the mean for this distribution.
(Overrides UnivariateContinuousDistributionMean.)
Public propertyMedian
Gets the median for this distribution.
(Inherited from UnivariateContinuousDistribution.)
Public propertyMode
This method is not supported.
(Overrides UnivariateContinuousDistributionMode.)
Public propertyQuartiles
Gets the Quartiles for this distribution.
(Inherited from UnivariateContinuousDistribution.)
Public propertyRanks
Gets the rank statistics for the distribution.
Public propertySamples1
Gets the number of observations in the first sample.
Public propertySamples2
Gets the number of observations in the second sample.
Public propertyStandardDeviation
Gets the Standard Deviation (the square root of the variance) for the current distribution.
(Inherited from UnivariateContinuousDistribution.)
Public propertySupport
Gets the support interval for this distribution.
(Overrides UnivariateContinuousDistributionSupport.)
Public propertyVariance
Gets the variance for this distribution.
(Overrides UnivariateContinuousDistributionVariance.)
Top
Methods
  NameDescription
Public methodClone
Creates a new object that is a copy of the current instance.
(Overrides DistributionBaseClone.)
Public methodComplementaryDistributionFunction
Gets the complementary cumulative distribution function (ccdf) for this distribution evaluated at point x. This function is also known as the Survival function.
(Inherited from UnivariateContinuousDistribution.)
Public methodCumulativeHazardFunction
Gets the cumulative hazard function for this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)
Public methodDistributionFunction(Double)
Gets the cumulative distribution function (cdf) for this distribution evaluated at point k.
(Overrides UnivariateContinuousDistributionDistributionFunction(Double).)
Public methodDistributionFunction(Double, Double)
Gets the cumulative distribution function (cdf) for this distribution in the semi-closed interval (a; b] given as P(a < X ≤ b).
(Inherited from UnivariateContinuousDistribution.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFit(Double)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodFit(Double, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodFit(Double, Double)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodFit(Double, Int32)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodFit(Double, Double, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodFit(Double, Int32, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)
Public methodGenerate
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.)
Public methodGenerate(Int32)
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.)
Public methodGenerate(Int32, Double)
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRange
Gets the distribution range within a given percentile.
(Inherited from UnivariateContinuousDistribution.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHazardFunction
Gets the hazard function, also known as the failure rate or the conditional failure density function for this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)
Public methodInverseDistributionFunction
Gets the inverse of the cumulative distribution function (icdf) for this distribution evaluated at probability p. This function is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.)
Public methodLogCumulativeHazardFunction
Gets the log of the cumulative hazard function for this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)
Public methodCode exampleLogProbabilityDensityFunction
Gets the log-probability density function (pdf) for this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionLogProbabilityDensityFunction(Double).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodCode exampleProbabilityDensityFunction
Gets the probability density function (pdf) for this distribution evaluated at point u.
(Overrides UnivariateContinuousDistributionProbabilityDensityFunction(Double).)
Public methodQuantileDensityFunction
Gets the first derivative of the inverse distribution function (icdf) for this distribution evaluated at probability p.
(Inherited from UnivariateContinuousDistribution.)
Public methodToString
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(IFormatProvider)
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(String)
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(String, IFormatProvider)
Returns a String that represents this instance.
(Overrides DistributionBaseToString(String, IFormatProvider).)
Public methodStatic memberUMinimum
Gets the Mann-Whitney's U statistic for the smaller sample.
Public methodStatic memberUSample1
Gets the Mann-Whitney's U statistic for the first sample.
Public methodStatic memberUSample2
Gets the Mann-Whitney's U statistic for the second sample.
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by Matrix.)
Top
Remarks

This is the distribution for Mann-Whitney's U statistic used in MannWhitneyWilcoxonTest. This distribution is based on sample Rank(Double, Boolean) statistics.

This is the distribution for the first sample statistic, U1. Some textbooks (and statistical packages) use alternate definitions for U, which should be compared with the appropriate statistic tables or alternate distributions.

Examples
// Consider the following rank statistics
double[] ranks = { 1, 2, 3, 4, 5 };

// Create a new Mann-Whitney U's distribution with n1 = 2 and n2 = 3
var mannWhitney = new MannWhitneyDistribution(ranks, n1: 2, n2: 3);

// Common measures
double mean = mannWhitney.Mean;     // 2.7870954605658511
double median = mannWhitney.Median; // 1.5219615583481305
double var = mannWhitney.Variance;  // 18.28163603621158

// Cumulative distribution functions
double cdf = mannWhitney.DistributionFunction(x: 4);               // 0.6
double ccdf = mannWhitney.ComplementaryDistributionFunction(x: 4); // 0.4
double icdf = mannWhitney.InverseDistributionFunction(p: cdf);     // 3.6666666666666661

// Probability density functions
double pdf = mannWhitney.ProbabilityDensityFunction(x: 4);     // 0.2
double lpdf = mannWhitney.LogProbabilityDensityFunction(x: 4); // -1.6094379124341005

// Hazard (failure rate) functions
double hf = mannWhitney.HazardFunction(x: 4); // 0.5
double chf = mannWhitney.CumulativeHazardFunction(x: 4); // 0.916290731874155

// String representation
string str = mannWhitney.ToString(); // MannWhitney(u; n1 = 2, n2 = 3)
See Also