@Test public void testLogGamma() { logger.info("LogGamma"); double Z = 3.0; double expResult = 0.69314718044741; double result = ContinuousDistributions.logGamma(Z); assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }
public static double logGamma(double Z) { double S = 1.0 + 76.18009173/Z-86.50532033/(Z+1.0)+24.01409822/(Z+2.0)-1.231739516/(Z+3.0)+0.00120858003/(Z+4.0)-0.00000536382/(Z+5.0); double LG = (Z-0.5)*Math.log(Z+4.5)-(Z+4.5)+Math.log(S*2.50662827465); return LG; }
ContinuousDistributions { public static double logGamma(double Z) { double S = 1.0 + 76.18009173/Z-86.50532033/(Z+1.0)+24.01409822/(Z+2.0)-1.231739516/(Z+3.0)+0.00120858003/(Z+4.0)-0.00000536382/(Z+5.0); double LG = (Z-0.5)*Math.log(Z+4.5)-(Z+4.5)+Math.log(S*2.50662827465); return LG; } }
ContinuousDistributions { public static double logGamma(double Z) { double S = 1.0 + 76.18009173/Z-86.50532033/(Z+1.0)+24.01409822/(Z+2.0)-1.231739516/(Z+3.0)+0.00120858003/(Z+4.0)-0.00000536382/(Z+5.0); double LG = (Z-0.5)*Math.log(Z+4.5)-(Z+4.5)+Math.log(S*2.50662827465); return LG; }  }
ContinuousDistributions { public static double logGamma(double Z) { double S = 1.0 + 76.18009173/Z-86.50532033/(Z+1.0)+24.01409822/(Z+2.0)-1.231739516/(Z+3.0)+0.00120858003/(Z+4.0)-0.00000536382/(Z+5.0); double LG = (Z-0.5)*Math.log(Z+4.5)-(Z+4.5)+Math.log(S*2.50662827465); return LG; }  static double chisquareCdf(double x, int df); static double gaussCdf(double z); static double gamma(double x); static double logGamma(double Z); static double studentsCdf(double x, int df); static double exponentialCdf(double x, double lamda); static double betaCdf(double x, double a, double b); static double fCdf(double x, int f1, int f2); static double gammaCdf(double x, double a, double b); static double uniformCdf(double x, double a, double b); static double kolmogorov(double z); static double gaussInverseCdf(double p); static double chisquareInverseCdf(double p, int df); static double normalQuantile(double p, double mu, double sigma); static double dirichletPdf(double[] pi, double[] ai); static double dirichletPdf(double[] pi, double a); static double[] multinomialGaussianSample(double[] mean, double[][] covariance); static double multinomialGaussianPdf(double[] mean, double[][] covariance, double[] x); }
ContinuousDistributions { public static double logGamma(double Z) { double S = 1.0 + 76.18009173/Z-86.50532033/(Z+1.0)+24.01409822/(Z+2.0)-1.231739516/(Z+3.0)+0.00120858003/(Z+4.0)-0.00000536382/(Z+5.0); double LG = (Z-0.5)*Math.log(Z+4.5)-(Z+4.5)+Math.log(S*2.50662827465); return LG; }  static double chisquareCdf(double x, int df); static double gaussCdf(double z); static double gamma(double x); static double logGamma(double Z); static double studentsCdf(double x, int df); static double exponentialCdf(double x, double lamda); static double betaCdf(double x, double a, double b); static double fCdf(double x, int f1, int f2); static double gammaCdf(double x, double a, double b); static double uniformCdf(double x, double a, double b); static double kolmogorov(double z); static double gaussInverseCdf(double p); static double chisquareInverseCdf(double p, int df); static double normalQuantile(double p, double mu, double sigma); static double dirichletPdf(double[] pi, double[] ai); static double dirichletPdf(double[] pi, double a); static double[] multinomialGaussianSample(double[] mean, double[][] covariance); static double multinomialGaussianPdf(double[] mean, double[][] covariance, double[] x);  }