unbbayes.simulation.likelihoodweighting.sampling
Class LikelihoodWeightingSampling

java.lang.Object
  extended by unbbayes.simulation.montecarlo.sampling.AMonteCarloSampling
      extended by unbbayes.simulation.montecarlo.sampling.MatrixMonteCarloSampling
          extended by unbbayes.simulation.likelihoodweighting.sampling.LikelihoodWeightingSampling
All Implemented Interfaces:
ILikelihoodWeightingSampling, IMonteCarloSampling, ILongTaskProgressObservable

public class LikelihoodWeightingSampling
extends MatrixMonteCarloSampling
implements ILikelihoodWeightingSampling

Likelihood Weighting sampling based on MC sampling. However, it does not sample for the evidence nodes, it just sets as the given state, and it calculates P(E|Par(E)) for each trial.

Author:
Rommel Carvalho (rommel.carvalho@gmail.com)

Field Summary
protected  List<Node> evidenceNodeList
           
protected  float[] probabilityEvidenceGivenParentList
           
 
Fields inherited from class unbbayes.simulation.montecarlo.sampling.AMonteCarloSampling
currentProgress, currentProgressStatus, factors, maxProgress, nTrials, pn, sampledStatesMap, sampledStatesMatrix, samplingNodeOrderQueue, timesSampled
 
Constructor Summary
LikelihoodWeightingSampling()
           
 
Method Summary
 float[] getCompactStatesSetWeight()
          Not implemented.
 float[] getFullStatesSetWeight()
          Return P(E|Par(E)) = ProductOf[P(Ei|Par(Ei))] for all evidences (findings).
 Map<Integer,Float> getMapStatesSetWeight()
          Not implemented.
protected  void simulate(int nTrial)
          Responsible for simulating MC for sampling.
 void start(ProbabilisticNetwork pn, int nTrials)
          Generates the MC sample with the given size for the given probabilistic network.
 
Methods inherited from class unbbayes.simulation.montecarlo.sampling.MatrixMonteCarloSampling
getSampledStatesCompactMatrix, getSampledStatesMap, getSampledStatesMatrix, getStatesSetTimesSampled
 
Methods inherited from class unbbayes.simulation.montecarlo.sampling.AMonteCarloSampling
addToSamplingOrderQueue, computeFactors, createSamplingOrderQueue, getCumulativeDistributionFunction, getCurrentProgress, getCurrentProgressStatus, getIndexInQueue, getLinearCoord, getMaxProgress, getMultidimensionalCoord, getParentsIndexesInQueue, getPercentageDone, getProbabilityMassFunction, getSamplingNodeOrderQueue, getState, initSamplingOrderQueue, notityObservers, registerObserver, removeObserver, updateProgress, updateProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface unbbayes.simulation.montecarlo.sampling.IMonteCarloSampling
getLinearCoord, getMultidimensionalCoord, getSampledStatesCompactMatrix, getSampledStatesMap, getSampledStatesMatrix, getSamplingNodeOrderQueue, getStatesSetTimesSampled
 
Methods inherited from interface unbbayes.util.longtask.ILongTaskProgressObservable
getCurrentProgress, getCurrentProgressStatus, getMaxProgress, getPercentageDone, notityObservers, registerObserver, removeObserver
 

Field Detail

evidenceNodeList

protected List<Node> evidenceNodeList

probabilityEvidenceGivenParentList

protected float[] probabilityEvidenceGivenParentList
Constructor Detail

LikelihoodWeightingSampling

public LikelihoodWeightingSampling()
Method Detail

getFullStatesSetWeight

public float[] getFullStatesSetWeight()
Return P(E|Par(E)) = ProductOf[P(Ei|Par(Ei))] for all evidences (findings). There is one probability associated with each trial.

Specified by:
getFullStatesSetWeight in interface ILikelihoodWeightingSampling
Returns:
P(E|Par(E)) for each trial.

start

public void start(ProbabilisticNetwork pn,
                  int nTrials)
Description copied from class: MatrixMonteCarloSampling
Generates the MC sample with the given size for the given probabilistic network.

Specified by:
start in interface IMonteCarloSampling
Overrides:
start in class MatrixMonteCarloSampling
Parameters:
pn - Probabilistic network that will be used for sampling.
nTrials - Number of trials to generate.

simulate

protected void simulate(int nTrial)
Description copied from class: MatrixMonteCarloSampling
Responsible for simulating MC for sampling.

Overrides:
simulate in class MatrixMonteCarloSampling
Parameters:
nTrial - The trial number to simulate.

getCompactStatesSetWeight

public float[] getCompactStatesSetWeight()
Not implemented.

Specified by:
getCompactStatesSetWeight in interface ILikelihoodWeightingSampling
Returns:
null.

getMapStatesSetWeight

public Map<Integer,Float> getMapStatesSetWeight()
Not implemented.

Specified by:
getMapStatesSetWeight in interface ILikelihoodWeightingSampling
Returns:
null.


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.