public final class GibbsSampler<V extends java.lang.Enum<V> & ParameterEnum,S extends ParameterizedState<V>,T extends DataCollection>
extends java.lang.Object
Constructor and Description |
---|
GibbsSampler(int numSamples,
ParameterizedModel<V,S,T> model)
Constructs a GibbsSampler given the total number of samples (including burn-in) and a
ParameterizedModel . |
Modifier and Type | Method and Description |
---|---|
<U> java.util.List<U> |
getSamples(V parameterName,
java.lang.Class<U> parameterValueClass,
int numBurnIn)
Returns a list of samples for a specified model parameter, discarding the first
numBurnIn samples. |
void |
runMCMC()
Runs the Monte Carlo Markov Chain, using the state of the model provided in the constructor to initialize.
|
void |
setNumSamplesPerLogEntry(int numSamplesPerLogEntry)
Changes the number of samples per log entry.
|
public GibbsSampler(int numSamples, ParameterizedModel<V,S,T> model)
ParameterizedModel
.
The ParameterizedState
held by the model is used to initialize the Monte Carlo Markov Chain and is taken
to be the first sample. Number of samples per log entry will be set to the default.numSamples
- total number of samples; must be positivemodel
- ParameterizedModel
to be sampledpublic void setNumSamplesPerLogEntry(int numSamplesPerLogEntry)
numSamplesPerLogEntry
- number of samples per log entry; must be positivepublic void runMCMC()
numSamplesPerLogEntry
.public <U> java.util.List<U> getSamples(V parameterName, java.lang.Class<U> parameterValueClass, int numBurnIn)
numBurnIn
samples.U
- type of parameter valueparameterName
- name of parameterparameterValueClass
- class of parameter valuenumBurnIn
- number of burn-in samples to discard from beginning of chain