Skip to main content
. 2015 Jun 20;31(20):3282–3289. doi: 10.1093/bioinformatics/btv378
Algorithm 1. splitHMC for the coalescent model
Initialize θ(1) at current θ=(f,τ)
Sample a new momentum value p(1)N(0,I)
Calculate H(θ(1),p(1))=U(θ(1))+K(p(1)) according to (13)
for =1 to L do
p(+12)=p()+ε/2[s()((D1)/2+α)βexp(τ())]pD(+12)=pD()ε/2f*()Tf*()/2τ(+12)=τ()+ε/2pD(+12)[f*(+1)pD*(+12)][cos(Λe12τ(+12)ε)sin(Λe12τ(+12)ε)sin(Λe12τ(+12)ε)cos(Λe12τ(+12)ε)][f*()pD*(+12)]τ(+1)=τ(+12)+ε/2pD(+12)pD(+1)=pD(+12)ε/2f*(+1)Tf*(+1)/2p(+1)=p(+12)+ε/2[s(+1)((D1)/2+α)βexp(τ(+1))]
end for
Calculate H(θ(+1),p(L+1))=U(θ(L+1))+K(p(L+1)) according to (13)
Calculate the acceptance probability α=min{1,exp[H(θ(+1),p(L+1))+H(θ(1),p(1))]}
Accept or reject the proposal according to α for the next state θ