Stat { public static double logit(double logodds) { return Math.exp(logodds) / (1 + Math.exp(logodds)); }  static double hg(long D, long gt, long S); static double hgapprox(long D, long gt, int S); static double beta_CDF(double x, int a, int b); static double incompleteBeta(double x, int a, int b); static double beta(int a, int b); static double ix(double x, int a, int b); static double logNfact(long n); static long nFactExact(long n); static double binom(int n, int i); static double logBinom(int n, int i); static double logoggs(double p); static double logit(double logodds); static void main(String[] args);  }
@Test public final void testLogit() { double arg1s[] = { 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 }; double ress[] = { 0.512, 0.525, 0.537, 0.55, 0.562, 0.574, 0.587, 0.599, 0.611, 0.622, 0.634, 0.646, 0.657, 0.668, 0.679, 0.69, 0.701, 0.711, 0.721 }; List<ModelDoubleDouble> testData = TestDataManager.fillTestCasesDoubleDouble(arg1s, ress); for (ModelDoubleDouble datum: testData) { assertEquals(datum.getRes(), Stat.logit(datum.getArg1()), TestDataManager.DELTA_DOUBLE); } }