3

This question concerns the calculation of the evidence, or marginal likelihood, from an existing MCMC sample without having to resample. There is an exhaustive and very helpful answer here: [Computation of the marginal likelihood from MCMC samples

I'm still not clear about nested sampling.

Is this algorithm below right or wrong?

The question is this: Is the method below right or wrong?

  1. I have an MCMC sample with N points in parameter space. Each point has a likelihood L.

  2. I order the N points by increasing L. So I obtain a series of L[i] where L[i+1]>L[i]. i runs from 0 to N-1

  3. I calculate X[i]=(N[i]-1)/N[i] where N[i] runs from 1 to N

  4. I therefore obtain a column of X and a column of LX.

  5. I integrate LX over X to obtain the Evidence.

Itinerant
  • 31
  • 2
  • 1
    Nested sampling cannot reuse existing MCMC samples from a target density (usually a posterior) to estimate the evidence term. Nested sampling has its own algorithm that uses weighted samples from the **prior density** of a Bayesian model, sorted by the value of the likelihood function at each sample, to approximate the evidence. At each iteration of nested sampling another sample is generated from the prior and used to advance the algorithm. Reusing existing posterior samples gives you samples from the wrong distribution and doesn't allow for generating new samples. – Carl Feb 13 '20 at 07:46

1 Answers1

0

As @Carl said, MCMC and nested sampling are quite different. You can use MCMC inside nested sampling to find new points, but in this case it is running on the prior probability distribution and rejects samples where the likelihood is below the current likelihood threshold.

So the basic steps are:

  1. obtain N live points by sampling directly from the prior
  2. identify lowest likelihood value of the live points Lmin, and remove it from the sample (dead point)
  3. replace that point by sampling from the prior, but do not accept points below Lmin (likelihood-restricted prior sampling, LRPS)
  4. go to 2.

I skipped the steps keeping track of the volume shrinkage (the i-th volume is $\exp(-i/N)$) and assigning weights to the dead points (the i-th dead point has weight $V_i/N \times L_i$). The dead sample give (after normalisation) a weighted posterior distribution. The normalisation is the evidence/marginal likelihood.

For the LRPS, you can use rejection sampling methods or MCMC-like step sampling methods. Examples of efficient rejection sampling methods are MultiNest and MLFriends (animation here). Examples of efficient step sampling methods include hit-and-run sampling, slice sampling and constrained Hamiltonian Monte Carlo.

j13r
  • 203
  • 1
  • 7