IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution Class Reference

Represents a χ2 distribution. More...

+ Inheritance diagram for Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution:
+ Collaboration diagram for Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution:

Public Member Functions

 ChiSquaredDistribution (int nu)
 Initializes a new χ2 distribution. More...
 
override double ProbabilityDensity (double x)
 Returns the probability density at the given point.
Parameters
xThe reference point.
Returns
The probability density p(x).
The probability density function (PDF) gives the relative probability of obtaining different values. More...
 
override double LeftProbability (double x)
 Returns the cumulative probability to the left of (below) the given point.
Parameters
xThe reference point.
Returns
The integrated probability to obtain a result below the reference point.
The left probability function is commonly called the cumulative distribution function (CDF). More...
 
override double RightProbability (double x)
 Return the cumulative probability to the right of (above) the given point.
Parameters
xThe reference point.
Returns
The integrated probability 1-P(x1) to obtain a result above the reference point.
In survival analysis, the right probability function is commonly called the survival function, because it gives the fraction of the population remaining after the given time. More...
 
override double InverseLeftProbability (double P)
 Returns the point at which the cumulative distribution function attains a given value.
Parameters
PThe left cumulative probability P, which must lie between 0 and 1.
Returns
The value x at which LeftProbability equals P.
The inverse left probability is commonly called the quantile function. Given a quantile, it tells which variable value is the lower border of that quantile. More...
 
override double Moment (int r)
 Computes a raw moment of the distribution.
Parameters
rThe order of the moment to compute.
Returns
The rth raw moment of the distribution.
See also
Moment
More...
 
override double MomentAboutMean (int r)
 Computes a central moment of the distribution.
Parameters
rThe order of the moment to compute.
Returns
The rth central moment of the distribution.
See also
Moment
More...
 
override double Cumulant (int r)
 Computes a cumulant of the distribution. More...
 
- Public Member Functions inherited from Meta.Numerics.Statistics.Distributions.Distribution
virtual double InverseRightProbability (double Q)
 Returns the point at which the right probability function attains the given value. More...
 
override double Moment (int r)
 Computes a raw moment of the distribution.
Parameters
rThe order of the moment to compute.
Returns
The rth raw moment of the distribution.
See also
Moment
More...
 
override double MomentAboutMean (int r)
 Computes a central moment of the distribution.
Parameters
rThe order of the moment to compute.
Returns
The rth central moment of the distribution.
See also
Moment
More...
 
virtual double ExpectationValue (Func< double, double > f)
 Computes the expectation value of the given function. More...
 
virtual double GetRandomValue (Random rng)
 Returns a random value. More...
 

Properties

int DegreesOfFreedom [get]
 Gets the number of degrees of freedom &#x3BD; of the distribution. More...
 
override double Mean [get]
 
override double Variance [get]
 
override double Median [get]
 
override double Skewness [get]
 
override double ExcessKurtosis [get]
 
override Interval Support [get]
 
- Properties inherited from Meta.Numerics.Statistics.Distributions.Distribution
virtual double Median [get]
 Gets the median of the distribution. More...
 
virtual Interval Support [get]
 Gets the interval over which the distribution is nonvanishing. More...
 
- Properties inherited from Meta.Numerics.Statistics.Distributions.UnivariateDistribution
virtual double Mean [get]
 Gets the mean of the distribution. More...
 
virtual double Variance [get]
 Gets the variance of the distribution. More...
 
virtual double StandardDeviation [get]
 Gets the standard deviation of the distribution. More...
 
virtual double Skewness [get]
 Gets the skewness of the distribution. More...
 
virtual double ExcessKurtosis [get]
 Gets the excess kurtosis of the distribution. More...
 

Private Attributes

readonly int nu
 
GammaDistribution gamma
 

Detailed Description

Represents a &#x3C7;2 distribution.

A chi squared distribution is an asymmetrical distribution ranging from zero to infinity with a peak near its number of degrees of freedom &#x3BD;. It is a one-parameter distribution determined entirely by the parameter nu.

The figure above shows the &#x3C7;2 distribution for &#x3BD; = 6, as well as the normal distribution with equal mean and variance for reference.

The sum of the squares of &#x3BD; independent standard-normal distributed variables is distributed as &#x3C7;2 with &#x3BD; degrees of freedom.

The &#x3C7;2 distribution appears in least-squares fitting as the distribution of the sum-of-squared-deviations under the null hypothesis that the model explains the data. For example, the goodness-of-fit statistic returned by the model our model fitting methods (UncertainMeasurementSample{T}.FitToFunction, UncertainMeasurementSample{T}.FitToLinearFunction, UncertainMeasurementSample.FitToLine, and others) follows a &#x3C7;2 distribution.

See also
ContingencyTable.PearsonChiSquaredTest

Constructor & Destructor Documentation

Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.ChiSquaredDistribution ( int  nu)
inline

Initializes a new &#x3C7;2 distribution.

Parameters
nuThe number of degrees of freedom, which must be positive.

Member Function Documentation

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.ProbabilityDensity ( double  x)
inlinevirtual

Returns the probability density at the given point.

Parameters
xThe reference point.
Returns
The probability density p(x).
The probability density function (PDF) gives the relative probability of obtaining different values.

Implements Meta.Numerics.Statistics.Distributions.Distribution.

References Meta.Numerics.Statistics.Distributions.GammaDistribution.ProbabilityDensity().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.LeftProbability ( double  x)
inlinevirtual

Returns the cumulative probability to the left of (below) the given point.

Parameters
xThe reference point.
Returns
The integrated probability to obtain a result below the reference point.
The left probability function is commonly called the cumulative distribution function (CDF).

Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.

References Meta.Numerics.Statistics.Distributions.GammaDistribution.LeftProbability().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.RightProbability ( double  x)
inlinevirtual

Return the cumulative probability to the right of (above) the given point.

Parameters
xThe reference point.
Returns
The integrated probability 1-P(x1) to obtain a result above the reference point.
In survival analysis, the right probability function is commonly called the survival function, because it gives the fraction of the population remaining after the given time.

Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.

References Meta.Numerics.Statistics.Distributions.GammaDistribution.RightProbability().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.InverseLeftProbability ( double  P)
inlinevirtual

Returns the point at which the cumulative distribution function attains a given value.

Parameters
PThe left cumulative probability P, which must lie between 0 and 1.
Returns
The value x at which LeftProbability equals P.
The inverse left probability is commonly called the quantile function. Given a quantile, it tells which variable value is the lower border of that quantile.

Reimplemented from Meta.Numerics.Statistics.Distributions.Distribution.

References Meta.Numerics.Statistics.Distributions.GammaDistribution.InverseLeftProbability().

Referenced by Test.BugTests.Bug2811().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Moment ( int  r)
inlinevirtual

Computes a raw moment of the distribution.

Parameters
rThe order of the moment to compute.
Returns
The rth raw moment of the distribution.
See also
Moment

Implements Meta.Numerics.Statistics.Distributions.UnivariateDistribution.

References Meta.Numerics.Functions.AdvancedMath.LogGamma().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.MomentAboutMean ( int  r)
inlinevirtual

Computes a central moment of the distribution.

Parameters
rThe order of the moment to compute.
Returns
The rth central moment of the distribution.
See also
Moment

Reimplemented from Meta.Numerics.Statistics.Distributions.UnivariateDistribution.

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Cumulant ( int  r)
inlinevirtual

Computes a cumulant of the distribution.

Parameters
rThe index of the cumulant to compute.
Returns
The rth cumulant of the distribution.

Reimplemented from Meta.Numerics.Statistics.Distributions.UnivariateDistribution.

References Meta.Numerics.Functions.AdvancedIntegerMath.Factorial(), and Meta.Numerics.MoreMath.Pow().

Member Data Documentation

readonly int Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.nu
private
GammaDistribution Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.gamma
private

Property Documentation

int Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.DegreesOfFreedom
get

Gets the number of degrees of freedom &#x3BD; of the distribution.

Referenced by FutureTest.FutureTest.ChiSquareDistribution(), and FutureTest.FutureTest.TwoSampleKS2().

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Mean
get

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Variance
get

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Median
get

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Skewness
get

override double Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.ExcessKurtosis
get

override Interval Meta.Numerics.Statistics.Distributions.ChiSquaredDistribution.Support
get


The documentation for this class was generated from the following file: