logit function

double logit (double p)

Computes the logit function, the inverse of the sigmoid logistic function. see: http://en.wikipedia.org/wiki/Logit

Implementation

double logit(double p) {
  if (p < 0.0 || p > 1.0) {
    throw ArgumentError.value(p, 'p', messages.argumentBetween0And1);
  }

  return log(p / (1.0 - p));
}