2
$\begingroup$

I have collected some GPS data from running over and around a hill many, many times.

The hill itself is about 9-10 meters high compared to the ground around it, although when I collected data, my altitude spanned about 25 meters.

I would like to be able to smooth the points so that I can describe the surface of the hill (latitude, longitude, and elevation). It's a bit cluttered, but I think it helps outline the paths that were taken, as well (I started with east-west rows, then north-south rows, then an inward spiral, then narrow figure-8s).

enter image description here

At points that are close to each other geographically, I noticed that there was quite a bit of variation over time. I took a look at the elevation over time, and I noticed that there was a drift:

enter image description here

There were a few breaks in time where I exited the bounds, usually to grab water, but for the most part the data uses 1-second intervals between each pair of points.

If it helps visualize the combination of the two graphs above, this version of the first graph uses 5 different shapes/facets for different bins of time. Keep in mind that I am running over the same region the entire duration, so the range of my altitude should be consistent over time if there weren't any drift.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Isn't your variation over time explained by the fact that you move from lower to upper regions? Your graph does not prove there is a drift. $\endgroup$ – user31264 Aug 18 '19 at 7:56
  • $\begingroup$ I made a graph that was a bit more clear with the values at different timestamps. You can see that the center is brighter (higher altitude) for the 4th and final fifths of the run (time-wise). The outer edges are also darker for the first couple fifths. I did sample the center more for the last two fifths than the first two, though, but that doesn't explain why the same regions have a clearly different average over the 5 different time intervals. $\endgroup$ – Max Candocia Aug 18 '19 at 13:24
  • $\begingroup$ I think you'll have to do something like the binning into 5ths in your last figure there. A hacky thing to do is to do would be some kind of smoothing with a factor variable for the time segments. Then take the mean of the factors coefficients to get your mean altitude. The smooth then picks up the variation around this? I share your intuition that the drift information is useable in some way... spatio-temporal smooths could be a way to go, again with some binning and a correlation (AR1?) through time. Not ideal bc these things are usually for modelling process not measurement error $\endgroup$ – ASeaton Aug 19 '19 at 14:47
  • $\begingroup$ How about this - make the assumption that the average altitude over the whole timeseries is accurate. Then compare the average in each time segment bin to the global average to get an estimated error in each timebin. Then use this to "detrend" your data and fit a model to the calibrated data. $\endgroup$ – ASeaton Aug 19 '19 at 14:52
  • $\begingroup$ One of my concerns is that my sampling isn't uniform over time. There are several paths that are common to most of my runs, but there are other areas (like parts of this run in an open field) which have very few points for reference. And even within a run, there appears to be a large moving average component to the error. $\endgroup$ – Max Candocia Aug 19 '19 at 18:05
2
$\begingroup$

A simple techinque would be to grid your data into 0.0005-degree bins and average the readings within each bin. In fact, you could've done this instead of running: picked out a grid and taken, say, 5 readings at each grid point and averaged them. (Or carry three or four GPS devices with you and average them.) On a more sophisticated note...

If you process each trail separately, it's common to use something like Kalman Smoothing to smooth location data. A common technique for calculating a smooth surface is Kriging (Gaussian Process regression) smoothing. (See here also.)

$\endgroup$
  • $\begingroup$ I just tried kriging with some success, although it becomes a bit more complicated when I introduce additional data to the mix from previous runs, which have different sizes and directions of measurement error. I'm going to look more into this, although I think there is valuable information in the timestamp that is discarded through the binning process. I've also tried without binning for the one run, as there were no duplicate coordinates. $\endgroup$ – Max Candocia Aug 18 '19 at 18:20
  • $\begingroup$ For individual runs, or perhaps as a preprocessing step, try a Kalman Filter. (Also known as the State Space approach.) Then maybe Kriging. I didn't put this into my answer because I'm a little nervous about a double procedure, but... $\endgroup$ – Wayne Aug 18 '19 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.