Bayesian Inference: How to judge my MCMC simulation converges?

Dear Professors,
In the manual of Bayesian Inference, Gelman-Rubin diagnosis is used to judge whether the MCMC simulation converges, but it seems that this convergence diagram cannot be output in the UQLab calculation results. Then which parameter should I use to judge whether my MCMC simulation converges?
best wishes
Student

Dear @Mr121Tony

Once you have created a Bayesian inversion analysis, say:

myBayesianAnalysis = uq_createAnalysis(BayesOpts)

you need to post-process this result to get the diagnostics. You can also apply a burn-in and compute other interesting quantities, see UQLab User manual “Bayesian inversion”, Section 1.3.5: Assessing convergence in MCMC simulations.

This can be done using:
uq_postProcessInversion(myBayesianAnalysis,'burnIn',0.3,'gelmanrubin', true);

Then the variable myBayesianAnalysis is enriched with a PostProc field, e.g.:

 myBayesianAnalysis.Results.PostProc

ans = 

  struct with fields:

           PostSample: [210×3×100 double]
    PostLogLikeliEval: [210×100 double]
            PostModel: [1×1 struct]
        PointEstimate: [1×1 struct]
           Dependence: [1×1 struct]
          Percentiles: [1×1 struct]
          PriorSample: [1000×3 double]
       PostPredSample: [1×1 struct]
                MPSRF: 1.0644

The last field MPSRFgives you the multivariate potential scale reduction factor diagnostic. It should be close to 1, typically < 1.1.

You can also visually check convergence by looking at the chains and make sure they are enough mixing over the support of the posterior distribution.

Best regards
Bruno

1 Like

@bsudret Thank you, professor. It’s very useful for me.