# How to correct for random measurement error?

• moonman239

#### moonman239

I am building an iPhone app where the iPhone is just going to sit on my desk measuring the distance to Earth's core. I will build a calibration function into my app to reduce the variation in the estimate. How, then, should I go about calibrating it?

I did not know the iPhone came with a device to measure the distance to the core of the Earth - I'm impressed :tongue:

Seriously though, if you are "measuring" the distance by reading off the position of the GPS on the phone and you know (or measure) that the phone is not moving you should be able to get a more precise position by simply taking the average position over a long time.

Note however, that modern GPS receivers already do a heck of a job filtering the raw GPS position to give you the best possible position filtered towards a normal kinematic model so you may have to average for a along time (many hours or perhaps even days) before you can expect to see a significant improvement.

Also note, that not moving your GPS receiver mean that some systematic errors in the position (like multipath) will not average out leaving you with a precise but inaccurate position. To get a more accurate position in this case you could make the precise long time averaging measurement in a place that has clear sight of the sky and away from tall buildings.

Frankly, if it were me making an app, I'd be satisfied with the usual 5-10 meter precision delivered by the GPS receiver. In addition to position you may also have access to a measure for how precise the current position is which you can then transform into how precise you can know the distance to the center of the Earth so you can display to your users something like "Distance to core: 6378137 ± 9 meter".

I'm curious if the GPS 3D coordinates for a location assume a particular geometric model for the Earth (like WGS84).

"Distance to the core" , I assume means distance to the "center of the earth". Or does it mean "distance to the edge of the core"? If it mean that, you would need a model for surface of the core.

I mean distance to the center of Earth. It's certainly doable, the iPhone has a built-in accelerometer (and gyroscope, so I could probably figure out a way to account for sudden movements).