On checkpoint functionality and chains' convergence

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Xin Wang
Posts: 43
Joined: January 11 2012
Affiliation: NAOC/NJU

On checkpoint functionality and chains'' convergence

Post by Xin Wang » May 07 2013

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!

Antony Lewis
Posts: 1948
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: On checkpoint functionality and chains'''''''' convergen

Post by Antony Lewis » May 14 2013

Checkpointing was accidentally broken in the April version. To fix, in MCMC.f90 move

Code: Select all

        if (checkpoint_burn/=0) checkpoint_burn = checkpoint_burn-1
down until outside the IF (thanks Silvia for reporting).

Xin Wang
Posts: 43
Joined: January 11 2012
Affiliation: NAOC/NJU

Re: On checkpoint functionality and chains'''''''''''''''' c

Post by Xin Wang » May 16 2013

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 &#40;CurLike < MaxLike&#41; 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

Code: Select all

        if &#40;checkpoint_burn/=0&#41; checkpoint_burn = checkpoint_burn-1
down until outside the IF (thanks Silvia for reporting).

Post Reply