Hi, all,
Could anyone please comment on how the .chk files come into being? Recently I've hacked the cosmomc to add one module, which is capable of contributing a very large -ln(likelihood) term (say up to 10^8) to the total 0.5*chi2. As a consequence, checkpoint never works and meanwhile chains are far from converging, no matter how much time it takes or how many points they accumulate.
Thanks a million!
On checkpoint functionality and chains' convergence
-
- Posts: 1948
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: On checkpoint functionality and chains'''''''' convergen
Checkpointing was accidentally broken in the April version. To fix, in MCMC.f90 move
down until outside the IF (thanks Silvia for reporting).
Code: Select all
if (checkpoint_burn/=0) checkpoint_burn = checkpoint_burn-1
Re: On checkpoint functionality and chains'''''''''''''''' c
Thanks, Antony! You mean to revise the body of subroutine MoveDone into this?
Code: Select all
if (accpt) then
num_accept = num_accept + 1
thin=1
if (present(thin_fac)) thin=thin_fac
want= num_accept> burn_in .and. checkpoint_burn ==0 .and. CurLike /= LogZero
if (want) then
acc = acc + mult
indep_acc= indep_acc + mult
end if
if (acc >= thin) then
if (want) then
output_lines = output_lines +1
call WriteParams(CurParams,real(acc/thin,mcp),CurLike)
end if
acc = mod(acc, thin)
end if
if (checkpoint_burn/=0) checkpoint_burn = checkpoint_burn-1 ! checkpoint_burn fixed
if (indep_sample /= 0 .and. indep_acc >= indep_sample*thin .and. want) then
call WriteIndepSample(CurParams, CurLike,real(indep_acc/(indep_sample*thin),mcp))
indep_acc = mod(indep_acc, indep_sample*thin)
end if
if (CurLike < MaxLike) MaxLike = CurLike
mult=1
else
mult = mult + 1
end if
Antony Lewis wrote:Checkpointing was accidentally broken in the April version. To fix, in MCMC.f90 move
down until outside the IF (thanks Silvia for reporting).Code: Select all
if (checkpoint_burn/=0) checkpoint_burn = checkpoint_burn-1