Click or drag to resize
Accord.NET (logo)

UnivariateDiscreteDistributionDistributionFunction Method (Int32, Boolean)

Gets P(X ≤ k) or P(X < k), the cumulative distribution function (cdf) for this distribution evaluated at point k, depending on the value of the inclusive parameter.

Namespace:  Accord.Statistics.Distributions.Univariate
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax
public virtual double DistributionFunction(
	int k,
	bool inclusive
)
Request Example View Source

Parameters

k
Type: SystemInt32
A single point in the distribution range.
inclusive
Type: SystemBoolean
True to return P(X ≤ x), false to return P(X < x). Default is true.

Return Value

Type: Double
Remarks
The Cumulative Distribution Function (CDF) describes the cumulative probability that a given value or any value smaller than it will occur.
Examples
// Compute P(X = k) 
double equal = dist.ProbabilityMassFunction(k: 1);

// Compute P(X < k) 
double less = dist.DistributionFunction(k: 1, inclusive: false);

// Compute P(X ≤ k) 
double lessThanOrEqual = dist.DistributionFunction(k: 1, inclusive: true);

// Compute P(X > k) 
double greater = dist.ComplementaryDistributionFunction(k: 1);

// Compute P(X ≥ k) 
double greaterThanOrEqual = dist.ComplementaryDistributionFunction(k: 1, inclusive: true);
See Also