A MCMC approach to maximum likelihood estimation