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.BetaDistribution Class Reference

Represents a beta distribution. More...

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

Public Member Functions

 BetaDistribution (double alpha, double beta)
 Initializes a new β 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 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 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 InverseRightProbability (double Q)
 Returns the point at which the right probability function attains the given value.
Parameters
QThe right cumulative probability, which must lie between 0 and 1.
Returns
The value x for which RightProbability equals Q.
More...
 
override double GetRandomValue (Random rng)
 Returns a random value.
Parameters
rngA random number generator.
Returns
A number distributed according to the distribution.
Note that the random number generator rng will be advanced by this method. The next call to its generator methods will not give the same value as it would had it not been passed to this method. More...
 
- Public Member Functions inherited from Meta.Numerics.Statistics.Distributions.Distribution
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...
 
- Public Member Functions inherited from Meta.Numerics.Statistics.Distributions.UnivariateDistribution
virtual double Cumulant (int r)
 Computes a cumulant of the distribution. More...
 

Static Public Member Functions

static FitResult FitToSample (Sample sample)
 Computes the Beta distribution that best fits the given sample. More...
 

Properties

double Alpha [get]
 Gets the left shape parameter. More...
 
double Beta [get]
 Gets the right shape parameter. More...
 
override Interval Support [get]
 
override double Mean [get]
 
override double Variance [get]
 
override double Skewness [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 double alpha
 
readonly double beta
 
readonly double bigB
 
readonly IDeviateGenerator betaRng
 
readonly BetaInverter betaInverter
 

Detailed Description

Represents a beta distribution.

The beta distribution is defined on the interval [0,1]. Depending on its two shape parameters, it can take on a wide variety of forms on this interval.

If the two shape parameters are equal, the distribution is symmetric. If the first shape parameter is less than one, the distribution has a singularity at its left endpoint. If the first shape parameter is greater than one, the distribution goes to zero at its left endpoint. The second shape parameter similarly governs the distribution's behavior at its right endpoint.

When both shape parameters are one, the beta distribution reduces to a standard uniform distribution.

Beta distributions describe the maximum and minimum values obtained from multiple, independent draws from a standard uniform distribution. For n draws, the maximum value is distributed as B(n,1).

Similiarly, the minimum value is distributed as B(1,n).

Because of the wide variety of shapes it can take, the beta distribution is sometimes used as an ad hoc model to describe any distribution observed on a finite interval.

Constructor & Destructor Documentation

Meta.Numerics.Statistics.Distributions.BetaDistribution.BetaDistribution ( double  alpha,
double  beta 
)
inline

Initializes a new &#x3B2; distribution.

Parameters
alphaThe left shape parameter, which controls the form of the distribution near x=0.
betaThe right shape parameter, which controls the form of the distribution near x=1.

The alpha shape parameter controls the form of the distribution near x=0. The beta shape parameter controls the form of the distribution near z=1. If a shape parameter is less than one, the PDF diverges on the side of the distribution it controls. If a shape parameter is greater than one, the PDF goes to zero on the side of the distribution it controls. If the left and right shapre parameters are equal, the distribution is symmetric about x=1/2.

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

Member Function Documentation

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.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.

Referenced by Meta.Numerics.Statistics.Distributions.FisherDistribution.ProbabilityDensity().

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.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.Functions.AdvancedMath.LeftRegularizedBeta().

Referenced by Test.BugTests.Bug7684(), and Meta.Numerics.Statistics.Distributions.FisherDistribution.LeftProbability().

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.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.Functions.AdvancedMath.LeftRegularizedBeta().

Referenced by Meta.Numerics.Statistics.Distributions.FisherDistribution.RightProbability().

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.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.

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.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.BetaDistribution.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.

Referenced by Test.BugTests.Bug7684(), Meta.Numerics.Statistics.Distributions.StudentDistribution.InverseLeftProbability(), and Meta.Numerics.Statistics.Distributions.FisherDistribution.InverseLeftProbability().

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.InverseRightProbability ( double  Q)
inlinevirtual

Returns the point at which the right probability function attains the given value.

Parameters
QThe right cumulative probability, which must lie between 0 and 1.
Returns
The value x for which RightProbability equals Q.

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

Referenced by Meta.Numerics.Statistics.Distributions.FisherDistribution.InverseRightProbability().

override double Meta.Numerics.Statistics.Distributions.BetaDistribution.GetRandomValue ( Random  rng)
inlinevirtual

Returns a random value.

Parameters
rngA random number generator.
Returns
A number distributed according to the distribution.
Note that the random number generator rng will be advanced by this method. The next call to its generator methods will not give the same value as it would had it not been passed to this method.

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

static FitResult Meta.Numerics.Statistics.Distributions.BetaDistribution.FitToSample ( Sample  sample)
inlinestatic

Computes the Beta distribution that best fits the given sample.

Parameters
sampleThe sample to fit.
Returns
The best fit parameters.

The returned fit parameters are the &#x3B1; (Alpha) and &#x3B2; (Beta) parameters, in that order. These are the same parameters, in the same order, that are required by the BetaDistribution(double,double) constructor to specify a new Beta distribution.

Exceptions
ArgumentNullExceptionsample is null.
InsufficientDataExceptionsample contains fewer than three values.
InvalidOperationExceptionNot all the entries in sample lie between zero and one.

References Meta.Numerics.Matrices.SymmetricMatrix.CholeskyDecomposition(), Meta.Numerics.Statistics.Sample.Count, Meta.Numerics.Analysis.FunctionMath.FindZero(), Meta.Numerics.Matrices.CholeskyDecomposition.Inverse(), and Meta.Numerics.Functions.AdvancedMath.Psi().

Referenced by Test.SampleTest.BetaFit(), and Test.SampleTest.BetaFitUncertainty().

Member Data Documentation

readonly double Meta.Numerics.Statistics.Distributions.BetaDistribution.alpha
private
readonly double Meta.Numerics.Statistics.Distributions.BetaDistribution.beta
private
readonly double Meta.Numerics.Statistics.Distributions.BetaDistribution.bigB
private
readonly IDeviateGenerator Meta.Numerics.Statistics.Distributions.BetaDistribution.betaRng
private
readonly BetaInverter Meta.Numerics.Statistics.Distributions.BetaDistribution.betaInverter
private

Property Documentation

double Meta.Numerics.Statistics.Distributions.BetaDistribution.Alpha
get

Gets the left shape parameter.

Referenced by Test.SampleTest.BetaFit(), and Test.DistributionTest.TransformedBetaMoments().

double Meta.Numerics.Statistics.Distributions.BetaDistribution.Beta
get

Gets the right shape parameter.

Referenced by Test.SampleTest.BetaFit(), and Test.DistributionTest.TransformedBetaMoments().

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

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

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

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


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