@Test public void testCdf() { System.out.println("cdf"); TDistribution instance = new TDistribution(20); instance.rand(); assertEquals(1.581891e-09, instance.cdf(-10.0), 1E-15); assertEquals(0.02963277, instance.cdf(-2.0), 1E-7); assertEquals(0.1646283, instance.cdf(-1.0), 1E-7); assertEquals(0.5, instance.cdf(0.0), 1E-7); assertEquals(0.8353717, instance.cdf(1.0), 1E-7); assertEquals(0.9703672, instance.cdf(2.0), 1E-7); assertEquals(1.0, instance.cdf(10.0), 1E-7); }
@Override public double cdf(double x) { double p = 0.5 * Beta.regularizedIncompleteBetaFunction(0.5 * nu, 0.5, nu / (nu + x * x)); if (x >= 0) { return 1.0 - p; } else { return p; } }
TDistribution extends AbstractDistribution { @Override public double cdf(double x) { double p = 0.5 * Beta.regularizedIncompleteBetaFunction(0.5 * nu, 0.5, nu / (nu + x * x)); if (x >= 0) { return 1.0 - p; } else { return p; } } }
TDistribution extends AbstractDistribution { @Override public double cdf(double x) { double p = 0.5 * Beta.regularizedIncompleteBetaFunction(0.5 * nu, 0.5, nu / (nu + x * x)); if (x >= 0) { return 1.0 - p; } else { return p; } } TDistribution(int nu); }
TDistribution extends AbstractDistribution { @Override public double cdf(double x) { double p = 0.5 * Beta.regularizedIncompleteBetaFunction(0.5 * nu, 0.5, nu / (nu + x * x)); if (x >= 0) { return 1.0 - p; } else { return p; } } TDistribution(int nu); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @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); double cdf2tiled(double x); double quantile2tiled(double p); }
TDistribution extends AbstractDistribution { @Override public double cdf(double x) { double p = 0.5 * Beta.regularizedIncompleteBetaFunction(0.5 * nu, 0.5, nu / (nu + x * x)); if (x >= 0) { return 1.0 - p; } else { return p; } } TDistribution(int nu); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @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); double cdf2tiled(double x); double quantile2tiled(double p); final int nu; }