math-php
|
χ²-distribution (Chi-squared) https://en.wikipedia.org/wiki/Chi-squared_distribution. More...
Public Member Functions | |
__construct (float $k) | |
Constructor. More... | |
pdf (float $x) | |
Probability density function. More... | |
cdf (float $x) | |
Cumulative distribution function. More... | |
mean () | |
Mean of the distribution. More... | |
median () | |
Median - closed form approximation. 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 | |
χ²-distribution (Chi-squared) https://en.wikipedia.org/wiki/Chi-squared_distribution.
MathPHP\Probability\Distribution\Continuous\ChiSquared::__construct | ( | float | $k | ) |
Constructor.
float | $k | degrees of freedom parameter k >= 1 |
MathPHP\Probability\Distribution\Continuous\ChiSquared::cdf | ( | float | $x | ) |
Cumulative distribution function.
Cumulative t value up to a point, left tail.
/ k x \ γ | - , - | \ 2 2 /
CDF = ----------— / k \ Γ | - | \ 2 /
float | $x | Chi-square critical value (CV) > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\ChiSquared::mean | ( | ) |
Mean of the distribution.
μ = k
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\ChiSquared::median | ( | ) |
Median - closed form approximation.
/ 2 \³ median ≈ k | 1 - - | \ k /
MathPHP\Probability\Distribution\Continuous\ChiSquared::mode | ( | ) |
Mode of the distribution.
max(k - 2, 0)
MathPHP\Probability\Distribution\Continuous\ChiSquared::pdf | ( | float | $x | ) |
Probability density function.
1 -----------— x⁽ᵏ/²⁾⁻¹ ℯ⁻⁽ˣ/²⁾ χ²(k) = / k \ 2ᵏ/² Γ | - | \ 2 /
float | $x | point at which to evaluate > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\ChiSquared::variance | ( | ) |
Variance of the distribution.
var[X] = 2k
const MathPHP\Probability\Distribution\Continuous\ChiSquared::PARAMETER_LIMITS |
const MathPHP\Probability\Distribution\Continuous\ChiSquared::SUPPORT_LIMITS |