unbbayes.simulation.montecarlo.sampling
Interface IMonteCarloSampling

All Superinterfaces:
ILongTaskProgressObservable
All Known Subinterfaces:
ILikelihoodWeightingSampling
All Known Implementing Classes:
AMonteCarloSampling, LikelihoodWeightingSampling, MapMonteCarloSampling, MatrixMonteCarloSampling

public interface IMonteCarloSampling
extends ILongTaskProgressObservable


Method Summary
 int getLinearCoord(int[] multidimensionalCoord)
          Get the linear coordinate from the multidimensional one.
 byte[] getMultidimensionalCoord(int linearCoord)
          Get the multidimensional coordinate from the linear one.
 byte[][] getSampledStatesCompactMatrix()
          Returns the generated compact sample matrix.
 Map<Integer,Integer> getSampledStatesMap()
          Returns the generated sample map, with key = linear coord (representing the sates sampled) and value = number of times this key was sampled.
 byte[][] getSampledStatesMatrix()
          Returns the generated sample matrix.
 List<Node> getSamplingNodeOrderQueue()
          Return the order the nodes are in the sampled matrix.
 int[] getStatesSetTimesSampled()
          The number of times the ith set of states was sampled.
 void start(ProbabilisticNetwork pn, int nTrials)
          Generates the MC sample with the given size for the given probabilistic network.
 
Methods inherited from interface unbbayes.util.longtask.ILongTaskProgressObservable
getCurrentProgress, getCurrentProgressStatus, getMaxProgress, getPercentageDone, notityObservers, registerObserver, removeObserver
 

Method Detail

getSampledStatesMatrix

byte[][] getSampledStatesMatrix()
Returns the generated sample matrix. The row represents the ith trial and the column represents the jth node from the sampled order. The value matrix[i][j] represents the sampled state index (respecting the node's states order) for the jth node in the ith trial.

Returns:
The generated sample matrix.

getSampledStatesCompactMatrix

byte[][] getSampledStatesCompactMatrix()
Returns the generated compact sample matrix. The row represents the ith sampled state set and the column represents the jth node from the sampled order. The value matrix[i][j] represents the sampled state index (respecting the node's states order) for the jth node in the ith sampled state set. To get the number of times the ith set of states was sampled use getStatesSetTimesSampled().

Returns:
The generated compact sample matrix.

getStatesSetTimesSampled

int[] getStatesSetTimesSampled()
The number of times the ith set of states was sampled.

Returns:
The number of times the ith set of states was sampled.

getSampledStatesMap

Map<Integer,Integer> getSampledStatesMap()
Returns the generated sample map, with key = linear coord (representing the sates sampled) and value = number of times this key was sampled.

Returns:
The generated sample map.

getSamplingNodeOrderQueue

List<Node> getSamplingNodeOrderQueue()
Return the order the nodes are in the sampled matrix.

Returns:
The order the nodes are in the sampled matrix.

start

void start(ProbabilisticNetwork pn,
           int nTrials)
Generates the MC sample with the given size for the given probabilistic network.

Parameters:
pn - Probabilistic network that will be used for sampling.
nTrials - Number of trials to generate.

getLinearCoord

int getLinearCoord(int[] multidimensionalCoord)
Get the linear coordinate from the multidimensional one. LinearCoord = SumOf(StateOf[i] * FactorOf[i]), for all possible nodes (i).

Parameters:
multidimensionalCoord - Multidimensional coordinate (represented by the state for each node).
Returns:
The corresponding linear coordinate.

getMultidimensionalCoord

byte[] getMultidimensionalCoord(int linearCoord)
Get the multidimensional coordinate from the linear one.

Parameters:
linearCoord - The linear coordinate.
Returns:
The corresponding multidimensional coordinate.


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