Erlang Distribution Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
[SerializableAttribute]
public class ErlangDistribution : GammaDistribution
- Inheritance
- Object → Distribution → ContinuousDistribution → GammaDistribution → ErlangDistribution
Remarks
The Erlang distribution characterizes the distribution of the time it takes for an event to occur n times when the probability per unit time of the event occurring is constant.
The Erlang distribution is a special case of the Gamma distribution with the first parameter being an integer.
When the order equals 1, the Erlang distribution reduces to the Exponential distribution.
The order parameter (an integer) represents the number of events, and the scale parameter (a double) represents the mean time between events.
Applications of the Erlang distribution include modeling the time between arrivals of customers in a queue, the time until a certain number of failures occur in a system, and other processes where events happen at a constant rate.
Example
This example demonstrates how to create an Erlang distribution with non-standard parameters and use its properties and methods.
using System;
using Numerics.NET.Statistics.Distributions;
// Create an Erlang distribution with order 3 and scale 2.0
var erlang = new ErlangDistribution(3, 2.0);
// Distribution parameters
Console.WriteLine($"Order: {erlang.ShapeParameter}");
Console.WriteLine($"Scale: {erlang.ScaleParameter}");
// Functions
double pdf = erlang.ProbabilityDensityFunction(1.0);
double cdf = erlang.DistributionFunction(1.0);
Console.WriteLine($"PDF at x=1.0: {pdf}");
Console.WriteLine($"CDF at x=1.0: {cdf}");
// Moments
double mean = erlang.Mean;
double variance = erlang.Variance;
Console.WriteLine($"Mean: {mean}");
Console.WriteLine($"Variance: {variance}");
// Other properties
double entropy = erlang.Entropy;
double mode = erlang.Mode;
Console.WriteLine($"Entropy: {entropy}");
Console.WriteLine($"Mode: {mode}");
Constructors
Erlang | Constructs a new ErlangDistribution with the specified order and scale parameters. |
Properties
Capabilities |
Gets a value that indicates the capabilities of the distribution class.
(Inherited from Distribution) |
Entropy |
Gets the entropy of the distribution.
(Inherited from GammaDistribution) |
Inter |
Returns the inter-quartile range of this distribution.
(Inherited from ContinuousDistribution) |
IsSymmetrical |
Gets whether the distribution is known to be symmetrical around the mean.
(Inherited from ContinuousDistribution) |
IsUnimodal |
Gets whether the distribution has one or more modes.
(Inherited from ContinuousDistribution) |
Kurtosis |
Gets the kurtosis of the distribution.
(Inherited from GammaDistribution) |
Location |
Gets the location parameter for the distribution.
(Inherited from GammaDistribution) |
Mean |
Gets the mean or expectation value of the distribution.
(Inherited from GammaDistribution) |
Median |
Gets the median of the distribution.
(Inherited from ContinuousDistribution) |
Mode |
Gets the mode of the distribution.
(Inherited from GammaDistribution) |
Number |
Gets the number of modes of the distribution.
(Inherited from ContinuousDistribution) |
Scale |
Gets the scale parameter for the distribution.
(Inherited from GammaDistribution) |
Shape |
Gets the shape parameter for the distribution.
(Inherited from GammaDistribution) |
Skewness |
Gets the skewness of the distribution.
(Inherited from GammaDistribution) |
Standard |
Gets the standard deviation of the distribution.
(Inherited from Distribution) |
Statistic |
Gets the common symbol to describe a statistic
from the distribution.
(Inherited from Distribution) |
Support |
Gets the support of the distribution.
(Inherited from GammaDistribution) |
Variance |
Gets the variance of the distribution.
(Inherited from GammaDistribution) |
Methods
Cdf |
Evaluates the cumulative distribution function
(CDF) of this distribution for the specified value.
(Inherited from ContinuousDistribution) |
Distribution |
Evaluates the cumulative distribution function
(CDF) of this distribution for the specified value.
(Inherited from GammaDistribution) |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
Get |
Returns an array that contains all the modes of the distribution.
(Inherited from ContinuousDistribution) |
Get |
Returns the expectation value of a function.
(Inherited from ContinuousDistribution) |
Get |
Returns the un-normalized expectation value of a function over the specified interval.
(Inherited from ContinuousDistribution) |
Get |
Gets a vector containing a histogram of the expected number of samples
for a given total number of samples.
(Inherited from ContinuousDistribution) |
Get |
Gets a vector containing a histogram of the expected number of samples
for a given total number of samples.
(Inherited from ContinuousDistribution) |
Get |
Gets a vector whose bins contain the expected number of samples
for a given total number of samples.
(Inherited from ContinuousDistribution) |
Get | Serves as the default hash function. (Inherited from Object) |
Get |
Returns a sequence of random samples from the distribution.
(Inherited from ContinuousDistribution) |
Get |
Returns a sequence of random samples from the distribution.
(Inherited from ContinuousDistribution) |
Get |
Returns a sequence of random samples of the specified length from the distribution.
(Inherited from ContinuousDistribution) |
Get | Gets the Type of the current instance. (Inherited from Object) |
Hazard |
Returns the probability of failure at the specified value.
(Inherited from ContinuousDistribution) |
Inverse |
Returns the inverse of the DistributionFunction(Double).
(Inherited from ContinuousDistribution) |
Inverse |
Returns the inverse of the DistributionFunction(Double).
(Inherited from GammaDistribution) |
Left |
Returns the probability that a sample from the distribution
is less than the specified value.
(Inherited from ContinuousDistribution) |
Log |
Returns the logarithm of the probability density function
(PDF) of this distribution for the specified value.
(Inherited from GammaDistribution) |
Memberwise | Creates a shallow copy of the current Object. (Inherited from Object) |
Moment |
Returns the value of the moment function of the specified order.
(Inherited from GammaDistribution) |
Returns the value of the probability density function
(PDF) of this distribution for the specified value.
(Inherited from ContinuousDistribution) | |
Probability |
Returns the probability that a sample taken from the
distribution lies inside the specified interval.
(Inherited from ContinuousDistribution) |
Probability |
Returns the value of the probability density function
(PDF) of this distribution for the specified value.
(Inherited from GammaDistribution) |
Right |
Returns the probability that a sample from the distribution
is larger than the specified value.
(Inherited from ContinuousDistribution) |
Sample() |
Returns a random sample from the distribution.
(Inherited from ContinuousDistribution) |
Sample( |
Returns a vector of random samples from the distribution.
(Inherited from ContinuousDistribution) |
Sample( |
Returns a random sample from the distribution.
(Inherited from GammaDistribution) |
Sample( |
Returns a vector of random samples from the distribution.
(Inherited from ContinuousDistribution) |
Sample |
Fills a list with random numbers from the distribution.
(Inherited from ContinuousDistribution) |
Sample |
Fills a list with random numbers from the distribution.
(Inherited from ContinuousDistribution) |
Sample |
Fills a span with random numbers from the distribution.
(Inherited from ContinuousDistribution) |
Sample |
Fills part of a list with random numbers from the distribution.
(Inherited from ContinuousDistribution) |
Survivor |
Evaluates the survivor distribution function
(SDF) of this distribution for the specified value.
(Inherited from GammaDistribution) |
ToString | Returns a string that represents the current object. (Inherited from GammaDistribution) |
Two |
Returns the probability that a sample from the distribution deviates from the mean more than
the specified value.
(Inherited from ContinuousDistribution) |