MathPHP\Probability\Distribution\Continuous\StudentT::CDF PHP Method

CDF() public static method

cdf = 1 - ½Iₓ₍t₎(ν/2, ½) ν where x(t) = ------ t² + ν Iₓ₍t₎(ν/2, ½) is the regularized incomplete beta function
public static CDF ( number $t, integer )
$t number t score
integer degrees of freedom > 0
    public static function CDF($t, int $ν)
    {
        Support::checkLimits(self::LIMITS, ['t' => $t, 'ν' => $ν]);
        if ($t == 0) {
            return 0.5;
        }
        $x⟮t⟯ = $ν / ($t ** 2 + $ν);
        $ν/2 = $ν / 2;
        $½ = 0.5;
        $Iₓ = Special::regularizedIncompleteBeta($x⟮t⟯, $ν/2, $½);
        if ($t < 0) {
            return $½ * $Iₓ;
        }
        // $t ≥ 0
        return 1 - $½ * $Iₓ;
    }

Usage Example

Example #1
0
 /**
  * Cumulative distribution function
  *
  * Fᵥ,ᵤ(x) = Fᵥ,ᵤ(x),      if x ≥ 0
  *         = 1 - Fᵥ,₋ᵤ(x)  if x < 0
  *
  * @param number $x
  * @param int    $ν Degrees of freedom
  * @param number $μ Noncentrality parameter
  *
  * @return number
  */
 public static function CDF($x, int $ν, $μ)
 {
     Support::checkLimits(self::LIMITS, ['x' => $x, 'ν' => $ν, 'μ' => $μ]);
     if ($μ == 0) {
         return StudentT::CDF($x, $ν);
     }
     if ($x >= 0) {
         return self::F($x, $ν, $μ);
     }
     return 1 - self::F($x, $ν, -$μ);
 }
All Usage Examples Of MathPHP\Probability\Distribution\Continuous\StudentT::CDF