A Markov chain Monte Carlo method for estimation and assimilation into models