You are here

private static function PHPExcel_Calculation_Statistical::_incompleteGamma in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php \PHPExcel_Calculation_Statistical::_incompleteGamma()
2 calls to PHPExcel_Calculation_Statistical::_incompleteGamma()
PHPExcel_Calculation_Statistical::CHIDIST in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* CHIDIST * * Returns the one-tailed probability of the chi-squared distribution. * *
PHPExcel_Calculation_Statistical::GAMMADIST in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* GAMMADIST * * Returns the gamma distribution. * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php, line 425

Class

PHPExcel_Calculation_Statistical
PHPExcel_Calculation_Statistical

Code

private static function _incompleteGamma($a, $x) {
  static $max = 32;
  $summer = 0;
  for ($n = 0; $n <= $max; ++$n) {
    $divisor = $a;
    for ($i = 1; $i <= $n; ++$i) {
      $divisor *= $a + $i;
    }
    $summer += pow($x, $n) / $divisor;
  }
  return pow($x, $a) * exp(0 - $x) * $summer;
}