Search in sources :

Example 1 with MarkovChainListener

use of dr.inference.markovchain.MarkovChainListener in project beast-mcmc by beast-dev.

the class MCMC method init.

/**
     * Must be called before calling chain.
     *
     * @param options    the options for this MCMC analysis
     * @param schedule   operator schedule to be used in chain.
     * @param likelihood the likelihood for this MCMC
     * @param loggers    an array of loggers to record output of this MCMC run
     */
public void init(MCMCOptions options, Likelihood likelihood, OperatorSchedule schedule, Logger[] loggers) {
    MCMCCriterion criterion = new MCMCCriterion();
    criterion.setTemperature(options.getTemperature());
    mc = new MarkovChain(likelihood, schedule, criterion, options.getFullEvaluationCount(), options.minOperatorCountForFullEvaluation(), options.getEvaluationTestThreshold(), options.useCoercion());
    this.options = options;
    this.loggers = loggers;
    this.schedule = schedule;
    //initialize transients
    currentState = 0;
    if (Factory.INSTANCE != null) {
        for (MarkovChainListener listener : Factory.INSTANCE.getStateSaverChainListeners()) {
            mc.addMarkovChainListener(listener);
        }
    }
}
Also used : MarkovChain(dr.inference.markovchain.MarkovChain) MarkovChainListener(dr.inference.markovchain.MarkovChainListener)

Aggregations

MarkovChain (dr.inference.markovchain.MarkovChain)1 MarkovChainListener (dr.inference.markovchain.MarkovChainListener)1