ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StandardNormal.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
10 {
22  public static function cumulative($value)
23  {
24  return Normal::distribution($value, 0, 1, true);
25  }
26 
39  public static function distribution($value, $cumulative)
40  {
41  return Normal::distribution($value, 0, 1, $cumulative);
42  }
43 
53  public static function inverse($value)
54  {
55  return Normal::inverse($value, 0, 1);
56  }
57 
68  public static function gauss($value)
69  {
70  $value = Functions::flattenSingleValue($value);
71  if (!is_numeric($value)) {
72  return Functions::VALUE();
73  }
74 
75  return self::distribution($value, true) - 0.5;
76  }
77 
93  public static function zTest($dataSet, $m0, $sigma = null)
94  {
95  $dataSet = Functions::flattenArrayIndexed($dataSet);
97  $sigma = Functions::flattenSingleValue($sigma);
98 
99  if (!is_numeric($m0) || ($sigma !== null && !is_numeric($sigma))) {
100  return Functions::VALUE();
101  }
102 
103  if ($sigma === null) {
104  $sigma = StandardDeviations::STDEV($dataSet);
105  }
106  $n = count($dataSet);
107 
108  return 1 - self::cumulative((Averages::average($dataSet) - $m0) / ($sigma / sqrt($n)));
109  }
110 }
static inverse($probability, $mean, $stdDev)
NORMINV.
Definition: Normal.php:64
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing...
Definition: Functions.php:616
$n
Definition: RandomTest.php:85
static distribution($value, $mean, $stdDev, $cumulative)
NORMDIST.
Definition: Normal.php:27
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649