MathPHP\Probability\Distribution\Continuous\NoncentralT::F PHP Method

F() private static method

where Φ = cumulative distribution function of the standard normal distribution Iy(a,b) = regularized incomplete beta function x² y = ------ x² + ν 1 / μ² \ / μ² \ʲ pⱼ = -- exp| - - | | - | j! \ 2 / \ 2 / μ / μ² \ / μ² \ʲ qⱼ = ------------ exp| - - | | - | √2Γ(j + 3/2) \ 2 / \ 2 /
private static F ( number $x, integer , number ) : number
$x number
integer Degrees of freedom
number Noncentrality parameter
return number
    private static function F($x, int $ν, $μ)
    {
        Support::checkLimits(self::LIMITS, ['x' => $x, 'ν' => $ν, 'μ' => $μ]);
        $Φ = StandardNormal::CDF(-$μ);
        $y = $x ** 2 / ($x ** 2 + $ν);
        $sum = $Φ;
        $tol = 1.0E-8;
        $j = 0;
        do {
            $exp = exp(-1 * $μ ** 2 / 2) * ($μ ** 2 / 2) ** $j;
            $pⱼ = 1 / Combinatorics::factorial($j) * $exp;
            $qⱼ = $μ / sqrt(2) / Special::gamma($j + 3 / 2) * $exp;
            $I1 = Special::regularizedIncompleteBeta($y, $j + 1 / 2, $ν / 2);
            $I2 = Special::regularizedIncompleteBeta($y, $j + 1, $ν / 2);
            $delta = $pⱼ * $I1 + $qⱼ * $I2;
            $sum += $delta / 2;
            $j += 1;
        } while ($delta / $sum > $tol || $j < 10);
        return $sum;
    }