cdf method

  1. @override
num cdf(
  1. num x
)

Cumulative distribution function.

Implementation

@override
num cdf(num x) {
  // Approximation for large df
  if (degreesOfFreedom > 30) {
    return NormalDistribution(0, 1).cdf(x);
  }

  num n = degreesOfFreedom;
  num t = x;
  num a = (t + math.sqrt(t * t + n)) / (2 * math.sqrt(t * t + n));

  return _incompleteBeta(n / 2, n / 2, a);
}