@Test public void testLogP() { System.out.println("logP"); TDistribution instance = new TDistribution(20); instance.rand(); assertEquals(Math.log(2.660085e-09), instance.logp(-10.0), 1E-5); assertEquals(Math.log(0.05808722), instance.logp(-2.0), 1E-5); assertEquals(Math.log(0.2360456), instance.logp(-1.0), 1E-5); assertEquals(Math.log(0.3939886), instance.logp(0.0), 1E-5); assertEquals(Math.log(0.2360456), instance.logp(1.0), 1E-5); assertEquals(Math.log(0.05808722), instance.logp(2.0), 1E-5); assertEquals(Math.log(2.660085e-09), instance.logp(10.0), 1E-5); }
@Override public double logp(double x) { return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu)); }
TDistribution extends AbstractDistribution { @Override public double logp(double x) { return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu)); } }
TDistribution extends AbstractDistribution { @Override public double logp(double x) { return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu)); } TDistribution(int nu); }
TDistribution extends AbstractDistribution { @Override public double logp(double x) { return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu)); } 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 logp(double x) { return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu)); } 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; }