|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.UrnBallsSplitMerge
public class UrnBallsSplitMerge
Split-merge proposal distribution for the urn-and-balls model.
Constructor Summary | |
---|---|
UrnBallsSplitMerge(Model model,
java.util.Properties properties)
Creates a new UrnBallSplitMerge proposer for the given model. |
Method Summary | |
---|---|
PartialWorldDiff |
initialize(Evidence evidence,
java.util.List queries)
Sets up the given PartialWorldDiff to serve as the initial state of a Markov chain. |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UrnBallsSplitMerge(Model model, java.util.Properties properties)
Method Detail |
---|
public PartialWorldDiff initialize(Evidence evidence, java.util.List queries)
initialize
in interface Proposer
queries
- List of Query objectspublic double proposeNextState(PartialWorldDiff proposedWorld)
This method implements a split-merge proposal distribution. Two draws are chosen uniformly without replacement from the set of draws. If these two draws both yielded the same ball, that ball is "split" (its draws are reassigned randomly to that ball and a new ball) and new colors are sampled for that ball and the new ball. If the two draws yielded different balls, those balls are "merged" (one is deleted and all its draws are moved to the other ball) and a new color is sampled for the remaining ball. Note that these split-merge moves increase or decrease the number of balls in the world, so the number of unused balls stays constant.
There is also another move type that changes the total number of balls without changing the values of any BallDrawn variables. We do this type of move with probability NUM_BALLS_MOVE_PROB.
The log proposal ratio returned is specific to the chosen move type, and the chosen draws for a split-merge move. That is, we don't compute the probability of making the same proposal through a different move type or a different choice of draws. This is ok because each move type or choice of draws can be thought of as a separate MCMC kernel; we're just mixing these kernels together.
proposeNextState
in interface Proposer
public void updateStats(boolean accepted)
Proposer
accepted
is true) or rejected
(if accepted
is false).
updateStats
in interface Proposer
public void printStats()
Proposer
printStats
in interface Proposer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |