math-php
|
Gamma distribution https://en.wikipedia.org/wiki/Gamma_distribution. More...
Public Member Functions | |
__construct (float $k, float $θ) | |
Constructor. More... | |
pdf (float $x) | |
Probability density function. More... | |
cdf (float $x) | |
Cumulative distribution function. More... | |
mean () | |
Mean of the distribution. More... | |
median () | |
Approximation of the median of the distribution https://en.wikipedia.org/wiki/Gamma_distribution#Median_calculation. More... | |
mode () | |
Mode of the distribution. More... | |
variance () | |
Variance of the distribution. More... | |
![]() | |
inverse (float $target) | |
The Inverse CDF of the distribution. More... | |
between (float $x₁, float $x₂) | |
CDF between - probability of being between two points, x₁ and x₂ The area under a continuous distribution, that lies between two specified points. More... | |
outside (float $x₁, float $x₂) | |
CDF outside - Probability of being below x₁ and above x₂. More... | |
above (float $x) | |
CDF above - Probability of being above x to ∞ Area under a continuous distribution, that lies above a specified point. More... | |
rand () | |
Produce a random number with a particular distribution. More... | |
![]() | |
__construct (... $params) | |
Constructor. More... | |
Public Attributes | |
const | PARAMETER_LIMITS |
const | SUPPORT_LIMITS |
![]() | |
const | GUESS_THRESHOLD = 10 |
const | GUESS_ALLOWANCE = 8 |
Protected Attributes | |
$k | |
$θ | |
Gamma distribution https://en.wikipedia.org/wiki/Gamma_distribution.
MathPHP\Probability\Distribution\Continuous\Gamma::__construct | ( | float | $k, |
float | $θ | ||
) |
Constructor.
float | $k | shape parameter k > 0 |
float | $θ | scale parameter θ > 0 |
MathPHP\Probability\Distribution\Continuous\Gamma::cdf | ( | float | $x | ) |
Cumulative distribution function.
1 / x \ cdf = --— γ | k, - | Γ(k) \ θ /
float | $x | percentile x > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\Gamma::mean | ( | ) |
Mean of the distribution.
μ = k θ
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\Gamma::median | ( | ) |
Approximation of the median of the distribution https://en.wikipedia.org/wiki/Gamma_distribution#Median_calculation.
3k - 0.8 υ ≈ μ -----— 3k + 0.2
MathPHP\Probability\Distribution\Continuous\Gamma::mode | ( | ) |
Mode of the distribution.
mode = (k - 1)θ k ≥ 1
MathPHP\Probability\Distribution\Continuous\Gamma::pdf | ( | float | $x | ) |
Probability density function.
ₓ 1 ⁻- pdf = ---— xᵏ⁻¹ e θ Γ(k)θᵏ
float | $x | percentile x > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\Gamma::variance | ( | ) |
Variance of the distribution.
var[X] = kθ²
const MathPHP\Probability\Distribution\Continuous\Gamma::PARAMETER_LIMITS |
const MathPHP\Probability\Distribution\Continuous\Gamma::SUPPORT_LIMITS |