# Weighted discrete measurements of a value changing over time

The best way I can think to describe this question is by example: Imagine there is a ship sailing around the pacific ocean on an unknown path (possibly random.) Other ships passing by sometimes see this ship and radio in its location to me. Some of these scout ships have better instruments or a more trustworthy crew than others, so I assign an accuracy weight to each of them. If the ship were static, it would be a simple problem to collect all of the reports and calculate an area where the ship is located (with high probability.) How can I adapt this for when the ship is constantly moving (assuming a fixed speed.) Obviously newer reports need to be given more weight and older reports need to be "faded out" so the ship's calculated location changes over time.

I started trying to design something like this but I think I'm making it too complicated.

Is there a name for this sort of problem? Any suggestions for a good method to solve it? Thanks!

• That was just a hypothetical example. I'm not using this algorithm for geolocation.
– takteek
Mar 26 '11 at 1:59

Sounds like you might want to look at (Weighted) Moving Average.

• Thanks, I think. :) This is essentially what I was already doing but knowing what it's called will help. If there are no better answers after a while I'll accept this.
– takteek
Mar 26 '11 at 2:06
• @Mitch Wheat: Was speaking more towards the Weighted Moving Average. By using the moving average you can get the average speed/direction which will allow one to predict where the next location might be. The weighting gives him the ability to "phase out" the older reports.
– Suroot
Mar 26 '11 at 2:07
• Particularly for more complex systems, Kalman filtering and related methods should be investigated as well.
– Anonymous
Mar 26 '11 at 2:31
• @user57368 Thanks, that's looks very helpful. The "Example application" section on that page is basically a better-worded and more complete version of what I was trying to describe. If you want to post that as an answer I'll accept it. Sorry, Suroot. Your answer was helpful too though. :)
– takteek
Mar 26 '11 at 3:39
• Oops. When I said "that page" I meant the Kalman filter page on Wikipedia. I guess I only imagined that you linked to it.
– takteek
Mar 26 '11 at 3:49

There might be a bit of confusion here with some imprecise statistical jargon. If you have data points that have been measured/reported with different precision/reliability/variability then one turns naturally to Generalized Least Squares where one transforms/weights the data by adjusting for the relative variability . Search for Weighted Least Squares for example. Now given that one has weighted/transformed observed data one might we faced with another weighting issue. When you have correlated observations over space and/or time (taken at fixed intervals either time or space) one is advised to form an adaptive/autoregressive/auto-projected model called an ARIMA Model. Please review my answer to Seeking certain type of ARIMA explanation which suggests that an ARIMA is simply a weighted average of previous values. For example y(t)=.5*y(t-1)+.25*y(t-2)+.125*y(t-3) +.... or y(t)=.5*y(t-1)+.5y(t-12)

These are two totally different "weighting solutions" . From your very vivid example it might be that you might have both opportunities to investigate. For more on time series you might review some of my postings and review what others might have said.

• Better yet: for more on time series, check out the top users for the "time-series" tag. IMHO, it's best to pay attention to users who have relatively high votes per question answered. (Currently an average of 4.0 or more votes per question would be pretty good.)
– whuber
Mar 29 '11 at 21:59