@Test public void testP() { System.out.println("p"); FDistribution instance = new FDistribution(10, 20); instance.rand(); assertEquals(2.90264e-06, instance.p(0.01), 1E-10); assertEquals(0.01504682, instance.p(0.1), 1E-7); assertEquals(0.1198157, instance.p(0.2), 1E-7); assertEquals(0.687882, instance.p(0.5), 1E-6); assertEquals(0.7143568, instance.p(1), 1E-7); assertEquals(6.652967e-06, instance.p(10), 1E-10); }
@Override public double p(double x) { if (x <= 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Math.exp((0.5 * nu1 - 1.0) * Math.log(x) - 0.5 * (nu1 + nu2) * Math.log(nu2 + nu1 * x) + fac); }
FDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Math.exp((0.5 * nu1 - 1.0) * Math.log(x) - 0.5 * (nu1 + nu2) * Math.log(nu2 + nu1 * x) + fac); } }
FDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Math.exp((0.5 * nu1 - 1.0) * Math.log(x) - 0.5 * (nu1 + nu2) * Math.log(nu2 + nu1 * x) + fac); } FDistribution(int nu1, int nu2); }
FDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Math.exp((0.5 * nu1 - 1.0) * Math.log(x) - 0.5 * (nu1 + nu2) * Math.log(nu2 + nu1 * x) + fac); } 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 p(double x) { if (x <= 0.0) { throw new IllegalArgumentException("Invalid x: " + x); } return Math.exp((0.5 * nu1 - 1.0) * Math.log(x) - 0.5 * (nu1 + nu2) * Math.log(nu2 + nu1 * x) + fac); } 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; }