interval method

Array interval(
  1. double confidence
)

Interval with the given confidence around the mean, as [ppf((1 - confidence) / 2), isf((1 - confidence) / 2)].

Implementation

Array interval(double confidence) {
  if (confidence < 0.0 || confidence > 1.0) {
    throw FormatException('confidence must be in [0, 1], got $confidence');
  }
  var tail = (1.0 - confidence) / 2.0;
  return Array([ppf(tail), isf(tail)]);
}