MathPHP\Probability\Distribution\Discrete\NegativeBinomial::PMF PHP Метод

PMF() публичный статический Метод

b(x; r, p) = ₓ₋₁Cᵣ₋₁ pʳ * (1 - p)ˣ⁻ʳ
public static PMF ( integer $x, integer $r, float $p ) : float
$x integer number of trials required to produce r successes
$r integer number of successful events
$p float probability of success on an individual trial
Результат float
    public static function PMF(int $x, int $r, float $p) : float
    {
        Support::checkLimits(self::LIMITS, ['x' => $x, 'r' => $r, 'p' => $p]);
        $ₓ₋₁Cᵣ₋₁ = Combinatorics::combinations($x - 1, $r - 1);
        $pʳ = pow($p, $r);
        $⟮1 − p⟯ˣ⁻ʳ = pow(1 - $p, $x - $r);
        return $ₓ₋₁Cᵣ₋₁ * $pʳ * $⟮1 − p⟯ˣ⁻ʳ;
    }
NegativeBinomial