GammaDistribution<T>
Models & Types · AiDotNet.Distributions
Represents a Gamma probability distribution.
Inheritance: DistributionBase<T> → GammaDistribution<T>
For Beginners
The Gamma distribution is for modeling positive values only (like time until an event, or amounts of money). It’s very flexible - with shape=1 it becomes an exponential distribution, and with large shape it approaches a Normal distribution. The shape controls how “peaked” the distribution is, while rate controls how spread out.
How It Works
The Gamma distribution is a two-parameter family of continuous probability distributions commonly used to model waiting times, insurance claim amounts, and other positive-valued phenomena.
PDF: f(x) = (β^α / Γ(α)) * x^(α-1) * exp(-βx) for x > 0
Constructors
| Constructor | Summary |
|---|---|
GammaDistribution(T shape, T rate) |
Initializes a new Gamma distribution with specified shape and rate. |
Properties
| Property | Summary |
|---|---|
T Mean { get; } |
|
T Rate { get; } |
Gets the rate parameter (β). |
T Scale { get; } |
Gets the scale parameter (1/β). |
T Shape { get; } |
Gets the shape parameter (α). |
T Variance { get; } |
|
Vector<T> Parameters { get; set; } |
|
int NumParameters { get; } |
|
string[] ParameterNames { get; } |
Methods
| Method | Summary |
|---|---|
GammaDistribution<T> FromMeanVariance(T mean, T variance) |
Creates a Gamma distribution from mean and variance. |
Matrix<T> FisherInformation() |
|
T Cdf(T x) |
|
T InverseCdf(T p) |
|
T LogPdf(T x) |
|
T Pdf(T x) |
|
T Sample(Random random) |
|
Vector<T> GradLogPdf(T x) |