An inference problem in a mismatched setting: a spin-glass model with Mattis interaction