Model-based probabilistic inversion using magnetic data