public class MetropolisHastingsSampler extends java.lang.Object implements SamplingAlgorithm
Constructor and Description |
---|
MetropolisHastingsSampler(java.util.List<? extends Variable> latentVariables,
java.util.List<? extends Variable> variablesToSampleFrom,
MetropolisHastingsStep mhStep,
MHStepVariableSelector variableSelector,
double logProbabilityBeforeStep) |
Modifier and Type | Method and Description |
---|---|
NetworkSample |
sample()
Takes a sample with the algorithm and returns the state of the network for that sample.
|
void |
sample(java.util.Map<VariableReference,java.util.List<?>> samplesByVariable,
java.util.List<java.lang.Double> logOfMasterPForEachSample)
Takes a sample with the algorithm and saves it in the supplied map (creating a new entry in the list if the
Variable already exists).
|
void |
step()
Move forward the state of the Sampling Algorithm by a single step but do not return anything.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
takeSample
public MetropolisHastingsSampler(java.util.List<? extends Variable> latentVariables, java.util.List<? extends Variable> variablesToSampleFrom, MetropolisHastingsStep mhStep, MHStepVariableSelector variableSelector, double logProbabilityBeforeStep)
public void step()
SamplingAlgorithm
step
in interface SamplingAlgorithm
public void sample(java.util.Map<VariableReference,java.util.List<?>> samplesByVariable, java.util.List<java.lang.Double> logOfMasterPForEachSample)
SamplingAlgorithm
sample
in interface SamplingAlgorithm
samplesByVariable
- map to store sampled variable valueslogOfMasterPForEachSample
- list of log of master probability for each samplepublic NetworkSample sample()
SamplingAlgorithm
sample
in interface SamplingAlgorithm