Approximate computations for binary Markov random fields and their use in Bayesian models