org.omegahat.Simulation.MCMC
Class BoundedHastingsCoupledSampler

java.lang.Object
  |
  +--org.omegahat.Simulation.MCMC.NotifyingMCMCObject
        |
        +--org.omegahat.Simulation.MCMC.BaseMarkovChain
              |
              +--org.omegahat.Simulation.MCMC.CustomMarkovChain
                    |
                    +--org.omegahat.Simulation.MCMC.CustomHastingsCoupledSampler
                          |
                          +--org.omegahat.Simulation.MCMC.BoundedHastingsCoupledSampler
All Implemented Interfaces:
HastingsCoupledSampler, MarkovChain, NotifyingObject, java.lang.Runnable
Direct Known Subclasses:
BoundedHastingsCoupledMaximizer

public class BoundedHastingsCoupledSampler
extends CustomHastingsCoupledSampler

This extends CustomHastingsCoupledSampler by allowing boundaries to be set for each dimension. If a proposal generates a point outside the boundaries, the proposal is rejected.


Inner classes inherited from class org.omegahat.Simulation.MCMC.CustomMarkovChain
CustomMarkovChain.listenerPrinter, CustomMarkovChain.NormalGenerator
 
Inner classes inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject
NotifyingMCMCObject.MyHandle
 
Field Summary
protected  double[] maxVals
           
protected  double[] minVals
           
 
Fields inherited from class org.omegahat.Simulation.MCMC.CustomHastingsCoupledSampler
accepted, DEBUG, detailed, index, log_p_X, log_p_Y, log_q_X_to_Y, log_q_Y_to_X, logAcceptProb, numAccepted, numProposed, numSamplers, order, prng, proposal, state, target, uniformRand
 
Fields inherited from class org.omegahat.Simulation.MCMC.CustomMarkovChain
generator
 
Fields inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject
listeners
 
Constructor Summary
BoundedHastingsCoupledSampler(MultiState state, int numSamplers, UnnormalizedDensity target, HastingsCoupledProposal proposal, double[] minVals, double[] maxVals, PRNG prng)
           
BoundedHastingsCoupledSampler(MultiState state, int numSamplers, UnnormalizedDensity target, HastingsCoupledProposal proposal, PRNG prng, double[] minVals, double[] maxVals, boolean detailed)
           
 
Method Summary
protected  double acceptanceProb(java.lang.Object current, MultiState currentStateVector, java.lang.Object proposed, MultiState proposedStateVector, int which)
           
 double[] getMaxVals()
           
 double[] getMinVals()
           
protected  double logAcceptanceProb(java.lang.Object current, MultiState currentStateVector, java.lang.Object proposed, MultiState proposedStateVector, int which)
           
 double[] setMaxVals(double[] maxs)
           
 double[] setMinVals(double[] mins)
           
 
Methods inherited from class org.omegahat.Simulation.MCMC.CustomHastingsCoupledSampler
generate, getNumAccepted, getNumProposed, getNumSamplers, getProposal, getState, getTarget, initialize, iterate, permute, resetNumAccepted, resetNumProposed, setNumSamplers, setProposal, setState, setTarget, step
 
Methods inherited from class org.omegahat.Simulation.MCMC.CustomMarkovChain
generate, main
 
Methods inherited from class org.omegahat.Simulation.MCMC.BaseMarkovChain
run
 
Methods inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject
notifyAll, registerListener, unregisterListener
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

minVals

protected double[] minVals

maxVals

protected double[] maxVals
Constructor Detail

BoundedHastingsCoupledSampler

public BoundedHastingsCoupledSampler(MultiState state,
                                     int numSamplers,
                                     UnnormalizedDensity target,
                                     HastingsCoupledProposal proposal,
                                     PRNG prng,
                                     double[] minVals,
                                     double[] maxVals,
                                     boolean detailed)

BoundedHastingsCoupledSampler

public BoundedHastingsCoupledSampler(MultiState state,
                                     int numSamplers,
                                     UnnormalizedDensity target,
                                     HastingsCoupledProposal proposal,
                                     double[] minVals,
                                     double[] maxVals,
                                     PRNG prng)
Method Detail

getMinVals

public double[] getMinVals()

setMinVals

public double[] setMinVals(double[] mins)

getMaxVals

public double[] getMaxVals()

setMaxVals

public double[] setMaxVals(double[] maxs)

acceptanceProb

protected double acceptanceProb(java.lang.Object current,
                                MultiState currentStateVector,
                                java.lang.Object proposed,
                                MultiState proposedStateVector,
                                int which)
Overrides:
acceptanceProb in class CustomHastingsCoupledSampler

logAcceptanceProb

protected double logAcceptanceProb(java.lang.Object current,
                                   MultiState currentStateVector,
                                   java.lang.Object proposed,
                                   MultiState proposedStateVector,
                                   int which)
Overrides:
logAcceptanceProb in class CustomHastingsCoupledSampler