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?
I have an MCMC sample with N points in parameter space. Each point has a likelihood L.
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
I calculate X[i]=(N[i]-1)/N[i] where N[i] runs from 1 to N
I therefore obtain a column of X and a column of LX.
I integrate LX over X to obtain the Evidence.