# How can I smooth data in 2D coordinates that has time-dependent error?

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).

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:

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.

• 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. Commented Aug 18, 2019 at 7:56
• 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. Commented Aug 18, 2019 at 13:24
• 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 Commented Aug 19, 2019 at 14:47
• 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. Commented Aug 19, 2019 at 14:52
• 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. Commented Aug 19, 2019 at 18:05