|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunbbayes.simulation.montecarlo.sampling.AMonteCarloSampling
unbbayes.simulation.montecarlo.sampling.MatrixMonteCarloSampling
public class MatrixMonteCarloSampling
Class that implements the Monte Carlo simulation. It uses forward sampling to calculate a RV's probability mass function. Based on its pmf, it then calculates the cumulative density function. Finally, a random number between 0 and 1 is generated and the sampled state is defined by the state the random number relates based on its cdf.
Field Summary |
---|
Fields inherited from class unbbayes.simulation.montecarlo.sampling.AMonteCarloSampling |
---|
currentProgress, currentProgressStatus, factors, maxProgress, nTrials, pn, sampledStatesMap, sampledStatesMatrix, samplingNodeOrderQueue, timesSampled |
Constructor Summary | |
---|---|
MatrixMonteCarloSampling()
|
Method Summary | |
---|---|
byte[][] |
getSampledStatesCompactMatrix()
Returns the generated compact sample matrix. |
Map<Integer,Integer> |
getSampledStatesMap()
Not implemented. |
byte[][] |
getSampledStatesMatrix()
Returns the generated sample matrix. |
int[] |
getStatesSetTimesSampled()
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.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 |
Constructor Detail |
---|
public MatrixMonteCarloSampling()
Method Detail |
---|
public byte[][] getSampledStatesCompactMatrix()
AMonteCarloSampling
getStatesSetTimesSampled()
.
getSampledStatesCompactMatrix
in interface IMonteCarloSampling
getSampledStatesCompactMatrix
in class AMonteCarloSampling
public int[] getStatesSetTimesSampled()
getStatesSetTimesSampled
in interface IMonteCarloSampling
getStatesSetTimesSampled
in class AMonteCarloSampling
public Map<Integer,Integer> getSampledStatesMap()
getSampledStatesMap
in interface IMonteCarloSampling
getSampledStatesMap
in class AMonteCarloSampling
public byte[][] getSampledStatesMatrix()
getSampledStatesMatrix
in interface IMonteCarloSampling
getSampledStatesMatrix
in class AMonteCarloSampling
public void start(ProbabilisticNetwork pn, int nTrials)
start
in interface IMonteCarloSampling
start
in class AMonteCarloSampling
pn
- Probabilistic network that will be used for sampling.nTrials
- Number of trials to generate.protected void simulate(int nTrial)
nTrial
- The trial number to simulate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |