math-php
|
Public Member Functions | |
__construct (float $μ, float $λ) | |
Constructor. More... | |
pdf (float $x) | |
Log normal distribution - probability density function. More... | |
cdf (float $x) | |
Log normal distribution - cumulative distribution function. More... | |
inverse (float $p) | |
Inverse of CDF (quantile) More... | |
mean () | |
Mean of the distribution. More... | |
median () | |
Median of the distribution. 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 | |
$μ | |
$σ | |
MathPHP\Probability\Distribution\Continuous\LogNormal::__construct | ( | float | $μ, |
float | $λ | ||
) |
Constructor.
float | $μ | location parameter |
float | $λ | scale parameter > 0 |
MathPHP\Probability\Distribution\Continuous\LogNormal::cdf | ( | float | $x | ) |
Log normal distribution - cumulative distribution function.
https://en.wikipedia.org/wiki/Log-normal_distribution
1 1 / ln x - μ \
cdf = - + - erf | -----— | 2 2 \ √2σ /
float | $x | > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\LogNormal::inverse | ( | float | $p | ) |
Inverse of CDF (quantile)
exp(μ + σ * normal-inverse(p))
float | $p |
MathPHP\Probability\Distribution\Continuous\LogNormal::mean | ( | ) |
Mean of the distribution.
μ = exp(μ + σ²/2)
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\LogNormal::median | ( | ) |
Median of the distribution.
median = exp(μ)
MathPHP\Probability\Distribution\Continuous\LogNormal::mode | ( | ) |
Mode of the distribution.
mode = exp(μ - σ²)
MathPHP\Probability\Distribution\Continuous\LogNormal::pdf | ( | float | $x | ) |
Log normal distribution - probability density function.
https://en.wikipedia.org/wiki/Log-normal_distribution
(ln x - μ)² 1 - ----------
pdf = --— ℯ 2σ² xσ√2π
float | $x | > 0 |
Implements MathPHP\Probability\Distribution\Continuous\ContinuousDistribution.
MathPHP\Probability\Distribution\Continuous\LogNormal::variance | ( | ) |
Variance of the distribution.
var[X] = [exp(σ²) - 1][exp(2μ + σ²)]
const MathPHP\Probability\Distribution\Continuous\LogNormal::PARAMETER_LIMITS |
const MathPHP\Probability\Distribution\Continuous\LogNormal::SUPPORT_LIMITS |