/** Chi-Square */
  public void testChiSquare() {
    System.out.println("Chi-Square");

    MultivariatePolyaDistribution.PMF pmf =
        new MultivariatePolyaDistribution.PMF(
            VectorFactory.getDefault().copyValues(1.0, 200.0, 300.0), 100);
    ArrayList<Vector> samples = pmf.sample(RANDOM, NUM_SAMPLES);
    MultinomialDistribution.PMF mnd =
        new MultinomialDistribution.PMF(
            pmf.getParameters().scale(1.0 / pmf.getParameters().norm1()), pmf.getNumTrials());
    //        for( int i = 0; i < samples.size(); i++ )
    //        {
    //            double p1 = pmf.evaluate(samples.get(i));
    //            double p2 = mnd.evaluate(samples.get(i));
    //            System.out.println( "Delta = " + (p1-p2) + ", P(" + samples.get(i) + ") = " + p1 +
    // ", MND = " + p2 );
    //        }
    //        Vector bad = VectorFactory.getDefault().copyValues(4,40,56);
    //        System.out.println( "MPD: P(bad) = " + pmf.evaluate(bad) );
    //        System.out.println( "MND: P(bad) = " + mnd.evaluate(bad) );
    //        ChiSquareConfidence.Statistic chisquare =
    //            ChiSquareConfidence.evaluateNullHypothesis( Arrays.asList(bad), pmf );
    //        System.out.println( "Chi-Square: " + chisquare );

  }
  /** PMF constructors */
  public void testProbabilityFunctionConstructors() {
    System.out.println("PMF Constructors");

    MultivariatePolyaDistribution.PMF instance = new MultivariatePolyaDistribution.PMF();
    assertEquals(
        MultivariatePolyaDistribution.DEFAULT_DIMENSIONALITY, instance.getInputDimensionality());
    assertEquals(MultivariatePolyaDistribution.DEFAULT_NUM_TRIALS, instance.getNumTrials());

    int dim = RANDOM.nextInt(100) + 10;
    int numTrials = RANDOM.nextInt(100) + 10;
    instance = new MultivariatePolyaDistribution.PMF(dim, numTrials);
    assertEquals(dim, instance.getInputDimensionality());
    assertEquals(numTrials, instance.getNumTrials());

    Vector p = VectorFactory.getDefault().createUniformRandom(dim, 0.0, 10.0, RANDOM);
    instance = new MultivariatePolyaDistribution.PMF(p, numTrials);
    assertSame(p, instance.getParameters());
    assertEquals(numTrials, instance.getNumTrials());

    MultivariatePolyaDistribution.PMF i2 = new MultivariatePolyaDistribution.PMF(instance);
    assertNotSame(i2.getParameters(), instance.getParameters());
    assertEquals(i2.getParameters(), instance.getParameters());
    assertEquals(i2.getNumTrials(), instance.getNumTrials());
  }