ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Standardize.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
9 {
21  public static function execute($value, $mean, $stdDev)
22  {
23  $value = Functions::flattenSingleValue($value);
24  $mean = Functions::flattenSingleValue($mean);
25  $stdDev = Functions::flattenSingleValue($stdDev);
26 
27  try {
28  $value = self::validateFloat($value);
29  $mean = self::validateFloat($mean);
30  $stdDev = self::validateFloat($stdDev);
31  } catch (Exception $e) {
32  return $e->getMessage();
33  }
34 
35  if ($stdDev <= 0) {
36  return Functions::NAN();
37  }
38 
39  return ($value - $mean) / $stdDev;
40  }
41 }
static execute($value, $mean, $stdDev)
STANDARDIZE.
Definition: Standardize.php:21
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649