Class UtilityFunctions
Class contains Gamma, factorial, Beta and other functions used in statistical distributions formulas.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Chart.Statistics
Assembly: Syncfusion.Chart.Base.dll
Syntax
public static class UtilityFunctions
Methods
Beta(Double, Double)
Beta function.
Declaration
public static double Beta(double a, double b)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | a | |
| System.Double | b |
Returns
| Type |
|---|
| System.Double |
BetaCumulativeDistribution(Double, Double, Double)
Returns cumulative beta distribution. ( for x >= 0, a > 0, b > 0 )
Declaration
public static double BetaCumulativeDistribution(double a, double b, double x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | a | |
| System.Double | b | |
| System.Double | x |
Returns
| Type | Description |
|---|---|
| System.Double | Returns cumulative beta distribution. http://en.wikipedia.org/wiki/Beta_distribution) ( for x >= 0, a > 0, b > 0 ) |
BetaLn(Double, Double)
Logarithm of Beta function.
Declaration
public static double BetaLn(double a, double b)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | a | |
| System.Double | b |
Returns
| Type |
|---|
| System.Double |
Binomial(Int32, Int32)
Binomial coefficient n!/(k!(n-k)!) ( for n >= k >= 0 ).
Declaration
public static double Binomial(int n, int k)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | |
| System.Int32 | k |
Returns
| Type |
|---|
| System.Double |
Erf(Double)
Error function.
Declaration
public static double Erf(double x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | . |
Returns
| Type | Description |
|---|---|
| System.Double | Returns error function. |
Factorial(Int32)
Factorial n! ( for n >= 0 ).
Declaration
public static double Factorial(int n)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n |
Returns
| Type |
|---|
| System.Double |
FactorialLn(Int32)
Logarithm of factorial n! ( for n >= 0 ).
Declaration
public static double FactorialLn(int n)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n |
Returns
| Type |
|---|
| System.Double |
FCumulativeDistribution(Double, Double, Double)
Returns cumulative F distribution. ( for firstDegreeOfFreedom >= 1 and firstDegreeOfFreedom >= 1 )
Declaration
public static double FCumulativeDistribution(double fValue, double firstDegreeOfFreedom, double secondDegreeOfFreedom)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | fValue | |
| System.Double | firstDegreeOfFreedom | |
| System.Double | secondDegreeOfFreedom |
Returns
| Type | Description |
|---|---|
| System.Double | Returns T cumulative distribution. http://en.wikipedia.org/wiki/F_distribution) ( for degreeOfFreedom > 0 ) |
Gamma(Double)
Gamma function ( for y > 0 ).
Declaration
public static double Gamma(double y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | y |
Returns
| Type |
|---|
| System.Double |
GammaCumulativeDistribution(Double, Double)
Returns cumulative gamma distribution. http://en.wikipedia.org/wiki/Gamma_distribution ( for x >= 0, a > 0 )
Declaration
public static double GammaCumulativeDistribution(double a, double x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | a | |
| System.Double | x |
Returns
| Type | Description |
|---|---|
| System.Double | Returns cumulative gamma distribution. (http://en.wikipedia.org/wiki/Gamma_distribution) ( for x >= 0, a > 0 ) |
GammaLn(Double)
Natural logarithm of gamma function ( for y > 0 ).
Declaration
public static double GammaLn(double y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | y |
Returns
| Type |
|---|
| System.Double |
InverseBetaCumulativeDistribution(Double, Double, Double)
Returns inverse cumulative beta distribution. ( for 1 >= p >= 0 , a > 0, b > 0 )
Declaration
public static double InverseBetaCumulativeDistribution(double a, double b, double p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | a | Beta function parameter |
| System.Double | b | Beta function parameter |
| System.Double | p | Probability |
Returns
| Type | Description |
|---|---|
| System.Double | Returns inverse cumulative beta distribution. http://en.wikipedia.org/wiki/Beta_distribution) ( for p in [0,1], a > 0, b > 0 ) |
InverseErf(Double)
Inverse Error function. This is rational approximation of erf function. The absolute value of the relative error is less than 1.15�10-9 in the entire region.
Declaration
public static double InverseErf(double x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | value x is in (-1 , 1) range. |
Returns
| Type | Description |
|---|---|
| System.Double | Returns Value that corresponds to given x. |
InverseFCumulativeDistribution(Double, Double, Double)
Inverse cumulative F distribution. ( for firstDegreeOfFreedom >= 1 and firstDegreeOfFreedom >= 1 )
Declaration
public static double InverseFCumulativeDistribution(double p, double firstDegreeOfFreedom, double secondDegreeOfFreedom)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | p | Probability (must be in range [0, 1]. ) |
| System.Double | firstDegreeOfFreedom | |
| System.Double | secondDegreeOfFreedom |
Returns
| Type | Description |
|---|---|
| System.Double | Inverse F cumulative distribution. http://en.wikipedia.org/wiki/F_distribution) ( for firstDegreeOfFreedom >= 1 and firstDegreeOfFreedom >= 1 ) |
InverseNormalDistribution(Double)
Inverse Normal Distribution function. This is rational approximation of Normal Distribution function. The absolute value of the relative error is less than 1.15�10-9 in the entire region. Lower tail quantile for standard normal distribution function. This function returns an approximation of the inverse cumulative standard normal distribution function. I.e., given P, it returns an approximation to the X satisfying P = Pr{Z is smaller than X} where Z is a random variable from the standard normal distribution.
Declaration
public static double InverseNormalDistribution(double p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | p | Probability at which function is evaluated. p must be in ( 0,1 ) range. |
Returns
| Type | Description |
|---|---|
| System.Double | Returns Inverse cumulative distribution. |
InverseTCumulativeDistribution(Double, Double, Boolean)
Inverse cumulative T distribution. ( for degreeOfFreedom > 0 )
Declaration
public static double InverseTCumulativeDistribution(double p, double degreeOfFreedom, bool oneTail)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | p | Probability (must be in range [0, 1]. ) |
| System.Double | degreeOfFreedom | |
| System.Boolean | oneTail |
Returns
| Type | Description |
|---|---|
| System.Double | Inverse T cumulative distribution. http://en.wikipedia.org/wiki/T_distribution) ( for degreeOfFreedom > 0 ) |
NormalDistribution(Double)
Normal Distribution function.
Declaration
public static double NormalDistribution(double x)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | Value at which the distribution is evaluated. |
Returns
| Type | Description |
|---|---|
| System.Double | Returns cumulative distribution. ( Returns probability that normally distributed random variable (X - mean)/sigma is smaller than x.). |
NormalDistributionDensity(Double, Double, Double)
Returns Normal Distribution density function.
Declaration
public static double NormalDistributionDensity(double x, double m, double sigma)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | Value at which the distribution density is evaluated. |
| System.Double | m | Expected value of distribution (Mean value) |
| System.Double | sigma | Variance of distribution |
Returns
| Type |
|---|
| System.Double |
NormalDistributionDensityLn(Double, Double, Double)
Returns Logarithm of Normal Distribution density function.
Declaration
public static double NormalDistributionDensityLn(double x, double m, double sigma)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | Value at which the distribution density is evaluated. |
| System.Double | m | Expected value of distribution (Mean value) |
| System.Double | sigma | Variance of distribution |
Returns
| Type |
|---|
| System.Double |
TCumulativeDistribution(Double, Double, Boolean)
Returns cumulative T distribution. ( for degreeOfFreedom > 0 )
Declaration
public static double TCumulativeDistribution(double tValue, double degreeOfFreedom, bool oneTail)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | tValue | |
| System.Double | degreeOfFreedom | |
| System.Boolean | oneTail |
Returns
| Type | Description |
|---|---|
| System.Double | Returns T cumulative distribution. http://en.wikipedia.org/wiki/T_distribution) ( for degreeOfFreedom > 0 ) |