@Test public void testCdf() { System.out.println("cdf"); ChiSquareDistribution instance = new ChiSquareDistribution(20); instance.rand(); assertEquals(0.0, instance.cdf(0), 1E-7); assertEquals(2.571580e-20, instance.cdf(0.1), 1E-25); assertEquals(1.70967e-10, instance.cdf(1), 1E-15); assertEquals(0.03182806, instance.cdf(10), 1E-7); assertEquals(0.5420703, instance.cdf(20), 1E-7); assertEquals(0.9997785, instance.cdf(50), 1E-7); assertEquals(1.0, instance.cdf(100), 1E-7); }
@Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(nu / 2.0, x / 2.0); } }
ChiSquareDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(nu / 2.0, x / 2.0); } } }
ChiSquareDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(nu / 2.0, x / 2.0); } } ChiSquareDistribution(int nu); }
ChiSquareDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(nu / 2.0, x / 2.0); } } ChiSquareDistribution(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); @Override Mixture.Component M(double[] x, double[] posteriori); }
ChiSquareDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(nu / 2.0, x / 2.0); } } ChiSquareDistribution(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); @Override Mixture.Component M(double[] x, double[] posteriori); final int nu; }