Class Mcmc

java.lang.Object
  extended by Mcmc

public class Mcmc
extends java.lang.Object

This class is a template for implementing the MCMC algorithm. You need to fill in the constructor and the runMoreIterations() method.


Constructor Summary
Mcmc(BayesNet bn, Query q)
          This is the constructor for the class that you need to fill in.
 
Method Summary
 double[] runMoreIterations(int n)
          This method, which must be filled in, runs n additional iterations of the MCMC algorithm on the Bayes net and query that were specified when this object was constructed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mcmc

public Mcmc(BayesNet bn,
            Query q)
This is the constructor for the class that you need to fill in. Any initialization of the MCMC algorithm should go here. The parameters to the constructor specify the Bayes net and query on which MCMC is to be run.

Method Detail

runMoreIterations

public double[] runMoreIterations(int n)
This method, which must be filled in, runs n additional iterations of the MCMC algorithm on the Bayes net and query that were specified when this object was constructed. It is important to remember that the method must continue a previous execution of MCMC. It should not restart from scratch each time it is called. The method returns an array with the estimated probability of each value of the query variable as estimated by MCMC following the n additional iterations.