You are here

public static function PHPExcel_Calculation_Statistical::NORMINV in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php \PHPExcel_Calculation_Statistical::NORMINV()

* NORMINV * * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation. * *

Parameters

float $value: * @param float $mean Mean Value * @param float $stdDev Standard Deviation * @return float *

1 call to PHPExcel_Calculation_Statistical::NORMINV()
PHPExcel_Calculation_Statistical::NORMSINV in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php
* NORMSINV * * Returns the inverse of the standard normal cumulative distribution * *

File

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

Class

PHPExcel_Calculation_Statistical
PHPExcel_Calculation_Statistical

Code

public static function NORMINV($probability, $mean, $stdDev) {
  $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
  $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
  $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
  if (is_numeric($probability) && is_numeric($mean) && is_numeric($stdDev)) {
    if ($probability < 0 || $probability > 1) {
      return PHPExcel_Calculation_Functions::NaN();
    }
    if ($stdDev < 0) {
      return PHPExcel_Calculation_Functions::NaN();
    }
    return self::_inverse_ncdf($probability) * $stdDev + $mean;
  }
  return PHPExcel_Calculation_Functions::VALUE();
}