public static function PHPExcel_Calculation_Statistical::ZTEST in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Statistical.php \PHPExcel_Calculation_Statistical::ZTEST()
* ZTEST * * Returns the Weibull distribution. Use this distribution in reliability * analysis, such as calculating a device's mean time to failure. * *
Parameters
float $dataSet: * @param float $m0 Alpha Parameter * @param float $sigma Beta Parameter * @param boolean $cumulative * @return float *
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ Statistical.php, line 3638
Class
- PHPExcel_Calculation_Statistical
- PHPExcel_Calculation_Statistical
Code
public static function ZTEST($dataSet, $m0, $sigma = NULL) {
$dataSet = PHPExcel_Calculation_Functions::flattenArrayIndexed($dataSet);
$m0 = PHPExcel_Calculation_Functions::flattenSingleValue($m0);
$sigma = PHPExcel_Calculation_Functions::flattenSingleValue($sigma);
if (is_null($sigma)) {
$sigma = self::STDEV($dataSet);
}
$n = count($dataSet);
return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0) / ($sigma / SQRT($n)));
}