1. A computer-implemented method, comprising: receiving a reading from a magnetometer of a mobile device; comparing the reading to historical data; determining a confidence of a match between the reading and historical data, where the confidence is determined at least in part on historical data associated with Earth's magnetic field; and if the confidence of the match exceeds a threshold confidence level, calibrating the magnetometer with historical calibration data.