blog
Interface Proposer

All Known Implementing Classes:
DecayedProposer, GenericProposer, UrnBallsSplitMerge, UrnBallsSplitMergeNoIds

public interface Proposer

Interface for Metropolis-Hastings proposal distributions. A Proposer object must be able to create an initial state for the Markov chain, and propose a new state x' given any state x. It must also be able to compute the proposal ratio q(x | x') / q(x' | x), where q is the proposal distribution.

Implementations of the Proposer interface should have a constructor with two arguments: a blog.Model object defining the prior distribution, and a java.util.Properties object specifying configuration parameters.


Method Summary
 PartialWorldDiff initialize(Evidence evidence, java.util.List queries)
          Returns a PartialWorldDiff whose current version serves as the initial state for the Markov chain (its saved version is initially an empty instantiation).
 void printStats()
          Prints any relevant statistics about the internal behavior of this proposer.
 double proposeNextState(PartialWorldDiff proposedWorld)
          Proposes a next state for the Markov chain given the current state.
 void updateStats(boolean accepted)
          Updates any statistics maintained by this proposer to reflect the fact that the most recent proposal was accepted (if accepted is true) or rejected (if accepted is false).
 

Method Detail

initialize

PartialWorldDiff initialize(Evidence evidence,
                            java.util.List queries)
Returns a PartialWorldDiff whose current version serves as the initial state for the Markov chain (its saved version is initially an empty instantiation). This world satisfies the given evidence and is complete enough to answer the given queries. Furthermore, the proposer stores the given evidence and queries so that proposeNextState can also maintain these properties.

Parameters:
queries - List of Query objects

proposeNextState

double proposeNextState(PartialWorldDiff proposedWorld)
Proposes a next state for the Markov chain given the current state. The world argument is a PartialWorldDiff that the proposer can modify to create the proposal; the saved version that underlies this PartialWorldDiff is the state before the proposal. Returns the log proposal ratio: log (q(x | x') / q(x' | x))

The proposed world satisfies the evidence and is complete enough to answer the queries specified in the last call to initialize. Note that if this proposal distribution is a mixture or cycle of more elementary proposal distributions, the proposal probabilities q(x | x') and q(x' | x) may be specific to the elementary distribution used for this proposal.

Throws:
java.lang.IllegalStateException - if initialize has not been called

printStats

void printStats()
Prints any relevant statistics about the internal behavior of this proposer.


updateStats

void updateStats(boolean accepted)
Updates any statistics maintained by this proposer to reflect the fact that the most recent proposal was accepted (if accepted is true) or rejected (if accepted is false).