edu.ksu.cis.bnj.bbn.inference.approximate.sampling
Class LikelihoodWeighting
java.lang.Object
edu.ksu.cis.bnj.bbn.inference.Inference
edu.ksu.cis.bnj.bbn.inference.ApproximateInference
edu.ksu.cis.bnj.bbn.inference.approximate.sampling.MCMC
edu.ksu.cis.bnj.bbn.inference.approximate.sampling.LikelihoodWeighting
- All Implemented Interfaces:
- DataGenerator, Optionable
- public class LikelihoodWeighting
- extends MCMC
Forward sampling with likelihood weighting gets samples by
instantiating each node of the network (using the prior probabilities
of each node as a weight) in topological order. Evidence nodes are
automatically instantiated to the value given in the evidence file.
- Author:
- Roby Joehanes
Fields inherited from class edu.ksu.cis.bnj.bbn.inference.approximate.sampling.MCMC |
abort, abortTimer, defaultMaxIteration, generateSamples, listeners, maxIteration, NO_TIME_LIMIT, OPT_GENERATE_DATA, OPT_MAX_ITERATION, OPT_RUNNING_TIME_LIMIT, OPT_USE_MARKOV_BLANKET, random, runningTimeLimit, tuples, useMarkovBlanketScore |
Method Summary |
InferenceResult |
getMarginals()
Computes the LikelihoodWeighting algorithm and calculates the
posterior probabilities of the network |
java.lang.String |
getName()
Gets the name of the inference algorithm |
static void |
main(java.lang.String[] args)
|
Methods inherited from class edu.ksu.cis.bnj.bbn.inference.approximate.sampling.MCMC |
abort, addListener, cancelAbortTimer, generateData, generateData, getData, getDefaultOptions, getMarkovBlanketScore, getMaxIteration, getOptionsDialog, getRunningTimeLimit, isUseMarkovBlanketScore, removeListener, sendEvent, setAbortTimer, setMaxIteration, setRunningTimeLimit, setUseMarkovBlanketScore |
Methods inherited from class edu.ksu.cis.bnj.bbn.inference.Inference |
execute, getCurrentOptions, getGraph, getMAP, getMarginalsResult, getMPE, getOutputFile, getRunType, load, setGraph, setOption, setOptions, setOutputFile, setRunType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LikelihoodWeighting
public LikelihoodWeighting()
LikelihoodWeighting
public LikelihoodWeighting(BBNGraph g)
- The constructor for LikelihoodWeighting, which initializes the
graph on which to run inference.
- Parameters:
g
- - the BBNGraph on which to run inference
LikelihoodWeighting
public LikelihoodWeighting(BBNGraph g,
int i)
- An alternate constructor, which intializes the graph
on which to run inference and the number of samples to use
- Parameters:
g
- - the BBNGraph on which to run inferencei
- - the number of samples to generate during inference
getName
public java.lang.String getName()
- Gets the name of the inference algorithm
- Specified by:
getName
in interface DataGenerator
- Specified by:
getName
in class Inference
- Returns:
- String - the name of the inference algorithm (LikelihoodWeighting)
getMarginals
public InferenceResult getMarginals()
- Computes the LikelihoodWeighting algorithm and calculates the
posterior probabilities of the network
- Specified by:
getMarginals
in class Inference
- Returns:
- InferenceResult - contains the posterior probs
- See Also:
edu.ksu.cis.bnj.bbn.inference.approximate.sampling.MCMC#getMarginalsImpl(boolean)
main
public static void main(java.lang.String[] args)