34 return $e->getMessage();
37 if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) {
41 return self::calculateDistribution($value, $degrees, $tails);
54 public static function inverse($probability, $degrees)
63 return $e->getMessage();
70 $callback =
function ($value) use ($degrees) {
71 return self::distribution($value, $degrees, 2);
76 return $newtonRaphson->execute($probability);
94 $ttheta = atan2($value, sqrt($tterm));
98 if (($degrees % 2) === 1) {
107 while ($ti < $degrees) {
108 $tterm *= $tc * $tc * ($ti - 1) / $ti;
114 if (($degrees % 2) == 1) {
118 $tValue = 0.5 * (1 + $tsum);
120 return 1 - abs($tValue);
123 return 1 - abs((1 - $tValue) - $tValue);
static calculateDistribution(float $value, int $degrees, int $tails)
static distribution($value, $degrees, $tails)
TDIST.
static inverse($probability, $degrees)
TINV.
static validateFloat($value)
static validateProbability($probability)
static validateInt($value)
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.