statalign.base.mcmc
Class LOCALTopologyMove

java.lang.Object
  extended by statalign.mcmc.McmcMove
      extended by statalign.base.mcmc.LOCALTopologyMove

public class LOCALTopologyMove
extends McmcMove


Field Summary
 int nTopologyChanges
           
 
Fields inherited from class statalign.mcmc.McmcMove
acceptAllDuringFirstHalfBurnin, acceptanceCount, autoTune, lastMoveAccepted, lowCounts, maxAcceptance, maxProposalWidthControlVariable, minAcceptance, moveProposed, name, proposalCount, proposalWidthControlVariable, spanMultiplier
 
Constructor Summary
LOCALTopologyMove(McmcModule m, PriorDistribution<java.lang.Double> pr, double propVar, double _fastSwapProb, java.lang.String n)
           
 
Method Summary
 void afterMove(java.lang.Object externalState)
           
 void copyState(java.lang.Object externalState)
           
 double logPriorDensity(java.lang.Object externalState)
           
 double proposal(java.lang.Object externalState)
           
 void restoreState(java.lang.Object externalState)
           
 double setEdges(double a, double b, double c)
          Sets the three edges affected by the LOCAL move (nephew, parent and uncle) to the specified values.
 void updateLikelihood(java.lang.Object externalState)
           
 
Methods inherited from class statalign.mcmc.McmcMove
acceptanceRate, afterFirstHalfBurnin, getOwner, getParam, getTime, isParamChangeAccepted, move
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nTopologyChanges

public int nTopologyChanges
Constructor Detail

LOCALTopologyMove

public LOCALTopologyMove(McmcModule m,
                         PriorDistribution<java.lang.Double> pr,
                         double propVar,
                         double _fastSwapProb,
                         java.lang.String n)
Method Detail

setEdges

public double setEdges(double a,
                       double b,
                       double c)
Sets the three edges affected by the LOCAL move (nephew, parent and uncle) to the specified values. If any of the values are less than minEdgeLength then the change is not made, invalidProposal is set to true, and negative infinity is returned.

Parameters:
a - The edge length for the nephew
b - The edge length for the parent
c - The edge length for the uncle
Returns:
The log ratio of new versus old prior densities.

copyState

public void copyState(java.lang.Object externalState)
Specified by:
copyState in class McmcMove

proposal

public double proposal(java.lang.Object externalState)
Specified by:
proposal in class McmcMove

logPriorDensity

public double logPriorDensity(java.lang.Object externalState)
Specified by:
logPriorDensity in class McmcMove

updateLikelihood

public void updateLikelihood(java.lang.Object externalState)
Specified by:
updateLikelihood in class McmcMove

restoreState

public void restoreState(java.lang.Object externalState)
Specified by:
restoreState in class McmcMove

afterMove

public void afterMove(java.lang.Object externalState)
Overrides:
afterMove in class McmcMove