@Test public void testCdf() { System.out.println("cdf"); FDistribution instance = new FDistribution(10, 20); instance.rand(); assertEquals(5.878315e-09, instance.cdf(0.01), 1E-15); assertEquals(0.0003410974, instance.cdf(0.1), 1E-10); assertEquals(0.006161513, instance.cdf(0.2), 1E-9); assertEquals(0.1298396, instance.cdf(0.5), 1E-6); assertEquals(0.5244995, instance.cdf(1), 1E-7); assertEquals(0.9999914, instance.cdf(10), 1E-7); }
@Override public double cdf(double x) { if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x)); }
FDistribution extends AbstractDistribution { @Override public double cdf(double x) { if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x)); } }
FDistribution extends AbstractDistribution { @Override public double cdf(double x) { if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x)); } FDistribution(int nu1, int nu2); }
FDistribution extends AbstractDistribution { @Override public double cdf(double x) { if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x)); } FDistribution(int nu1, int nu2); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); }
FDistribution extends AbstractDistribution { @Override public double cdf(double x) { if (x < 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x)); } FDistribution(int nu1, int nu2); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); final int nu1; final int nu2; }