org.omegahat.Simulation.MCMC
Class CustomHastingsCoupledSampler
java.lang.Object
|
+--org.omegahat.Simulation.MCMC.NotifyingMCMCObject
|
+--org.omegahat.Simulation.MCMC.BaseMarkovChain
|
+--org.omegahat.Simulation.MCMC.CustomMarkovChain
|
+--org.omegahat.Simulation.MCMC.CustomHastingsCoupledSampler
- All Implemented Interfaces:
- HastingsCoupledSampler, MarkovChain, NotifyingObject, java.lang.Runnable
- Direct Known Subclasses:
- BoundedHastingsCoupledSampler
- public class CustomHastingsCoupledSampler
- extends CustomMarkovChain
- implements HastingsCoupledSampler
A Hastings Coupled Sampler that consistes of $C$ component
samplers. The target distribution of the $C$ components is created
by the product of $C$ independent copies of the target state. At
each time step, only one component is updated.
A separate proposal distribution can be used for each component.
These proposal distributions can be either GeneralProposal
s, or
HastingsCoupledProposals
. The latter propose the new state for
one sampler based on the current state of all samplers.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
proposal
protected HastingsCoupledProposal proposal
target
protected UnnormalizedDensity target
- proposal method
state
protected MultiState state
- target distribution
prng
protected PRNG prng
- the current state
order
protected int[] order
- Random Number Generator
index
protected int index
numSamplers
protected int numSamplers
numProposed
protected int numProposed
numAccepted
protected int numAccepted
logAcceptProb
protected double logAcceptProb
uniformRand
protected double uniformRand
accepted
protected boolean accepted
log_p_X
protected double log_p_X
log_q_X_to_Y
protected double log_q_X_to_Y
log_p_Y
protected double log_p_Y
log_q_Y_to_X
protected double log_q_Y_to_X
detailed
protected boolean detailed
DEBUG
public boolean DEBUG
CustomHastingsCoupledSampler
public CustomHastingsCoupledSampler(MultiState state,
int numSamplers,
UnnormalizedDensity target,
HastingsCoupledProposal proposal,
PRNG prng,
boolean detailed)
CustomHastingsCoupledSampler
public CustomHastingsCoupledSampler(MultiState state,
int numSamplers,
UnnormalizedDensity target,
HastingsCoupledProposal proposal,
PRNG prng)
getProposal
public HastingsCoupledProposal getProposal()
setProposal
public HastingsCoupledProposal setProposal(HastingsCoupledProposal proposal)
getTarget
public UnnormalizedDensity getTarget()
setTarget
public UnnormalizedDensity setTarget(UnnormalizedDensity target)
getState
public MCMCState getState()
- Description copied from interface:
MarkovChain
- Get the current state of the Markov Chain.
- Specified by:
getState
in interface MarkovChain
- Overrides:
getState
in class BaseMarkovChain
setState
public MCMCState setState(MultiState state)
getNumSamplers
public int getNumSamplers()
setNumSamplers
public int setNumSamplers(int numSamplers)
getNumAccepted
public int getNumAccepted()
resetNumAccepted
public int resetNumAccepted()
getNumProposed
public int getNumProposed()
resetNumProposed
public int resetNumProposed()
initialize
void initialize()
generate
public MCMCState generate(MultiState currentStateVector)
step
public void step()
- Generate the next state from the current state.
- Specified by:
step
in interface MarkovChain
- Overrides:
step
in class BaseMarkovChain
iterate
public void iterate(int howmany)
- Description copied from interface:
MarkovChain
- Perform several
step
s.
- Specified by:
iterate
in interface MarkovChain
- Overrides:
iterate
in class BaseMarkovChain
- Following copied from interface:
org.omegahat.Simulation.MCMC.MarkovChain
- Parameters:
n
- how many steps
permute
void permute()
acceptanceProb
protected double acceptanceProb(java.lang.Object current,
MultiState currentStateVector,
java.lang.Object proposed,
MultiState proposedStateVector,
int which)
logAcceptanceProb
protected double logAcceptanceProb(java.lang.Object current,
MultiState currentStateVector,
java.lang.Object proposed,
MultiState proposedStateVector,
int which)