@Test
public void testPdf() {

  Random gen = RandomUtils.getRandom();
  for (double alpha : new double[]{0.01, 0.1, 1, 2, 10, 100}) {
    for (double beta : new double[]{0.1, 1, 2, 100}) {
      Gamma g1 = new Gamma(alpha, beta, gen);
      for (double x : seq(0, 0.99, 0.1)) {
        double p = Math.pow(beta, alpha) * Math.pow(x, alpha - 1) *
          Math.exp(-beta * x - org.apache.mahout.math.jet.stat.Gamma.logGamma(alpha));
        assertEquals(String.format(Locale.ENGLISH, "alpha=%.2f, beta=%.2f, x=%.2f\n", alpha, beta, x),
          p, g1.pdf(x), 1.0e-9);
      }
    }
  }
}