Hi, I am developing an underwater compass based on magnetometer sensor. Based on my Experiments on many sensors, It seems that is difficult to guarantee the high accuracy, less than 5 degrees!
This is true for most electronic compass circuits. Even the expensive modules like the Honeywell HMC6343 report only +-2 degree accuracy for heading. The next complication is DC current and ferromagnetic materials in the vicinity of the sensor. Look at the datasheets for the HMC6343 and the HMC10XX series. They will give you some good information about the magnetoresistive sensors, types of distortion, and compensation schemes.