ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Fisher.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class Fisher
9 {
21  public static function distribution($value)
22  {
23  $value = Functions::flattenSingleValue($value);
24 
25  try {
27  } catch (Exception $e) {
28  return $e->getMessage();
29  }
30 
31  if (($value <= -1) || ($value >= 1)) {
32  return Functions::NAN();
33  }
34 
35  return 0.5 * log((1 + $value) / (1 - $value));
36  }
37 
49  public static function inverse($probability)
50  {
51  $probability = Functions::flattenSingleValue($probability);
52 
53  try {
55  } catch (Exception $e) {
56  return $e->getMessage();
57  }
58 
59  return (exp(2 * $probability) - 1) / (exp(2 * $probability) + 1);
60  }
61 }
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649