I am working on a simple application that allows the user to do a lot of different things with a GPX file (GPS track). Some things computed are: average speed, max speed, etc. The max speed values I'm getting are very unrealistic, and when I look at a plot of the data, it's clear that there are spikes that represent inaccuracies. See the image below, which was a snowboarding run I did the other day... there are two spikes of ~57mph and 70mph, which I know are inaccurate.
I'm a bit rusty on my statistics, but I know there are probably multiple approaches to filtering/smoothing/correcting this data to remove the erroneous values, while retaining the quality I desire.
What is the best approach to accomplish that goal, and why?
A quick explanation of how the values in the plot are generated: each point logged by the GPS unit contains latitude/longitude values and a time value. Using the spherical law of cosines, the distance between any neighboring points in the track can be calculated, and that along with the time elapsed gives the average speed for the segment between those two points. This is repeated for each set of neighboring points in the track to generate the plot above. Obviously the inaccurate speed values are a result of positioning error from the GPS unit... if it logs me too far backward for one logged point, and then too far forward for the next point, the distance covered in that segment is calculated as much higher than it really was, and therefore so is my speed. In the segment leading up to the highest spike in the plot above, I supposedly increased my speed from ~12mph to 70mph over a segment of 100ft.