How does Metropolis work with uniform priors

Hi all, I am a MCMC newbie, hope you wouldn’t mind me asking a question here.

How does Metropolis (pm.Metropolis) work with uniform priors? I am asking because I am getting some strange results:

I have three parameters: hk, ss and sy. All of them have uniform priors (pm.Uniform).

The trace plots for “ss” and “sy” are what I would expect from a uniform prior. However, the trace plot for “hk” seems to be stuck around a particular value. My likelihood function is very sensitive to “hk” and not so much to “ss” and “sy”, but I thought likelihood has no impact on the proposal of parameters that have a uniform prior…?

Many thanks for your advice.

Any reason why your using Metropolis and uniform priors? Both tend to be discouraged in favor of the No U-Turn Sampler (NUTS) and informative priors.
Maybe this explains the convergence problems you’re having?

1 Like

Thank you for the reply.

I am using a black box likelihood function which seems too slow for NUTS.

I think I have sorted out my problem now. Posterior is proportional to the product of prior and likelihood. As I am using uniform priors, the prior term can be neglected, meaning posterior is only proportional to likelihood. During the Metropolis sampling, once the sampler has located the likelihood minimum, it has a very low acceptance probability. The traceplot only contains the accepted runs (if the next proposed run is rejected, the current accepted run is repeated and added to the traceplot again), this is why I am seeing a straight line pattern in the hk traceplot.

This is just my theory and please feel free to comment if I have got it wrong. Many thanks.

Yeah, that seems right to me – your chain gets stuck at one point because of the uniform priors.
Changing to more informative priors should make it better – or… does it? :wink: