The fold test in paleomagnetism as a parameter estimation problem