I'm not sure how to phrase this, or even if such a thing exists. Sorry!
I have a bunch of data points, which are mostly pretty tight. Each group should hone in on a specific point in space. Unfortunately, some of the recordings are polluted with movements (i.e. a bump of the table). These movements always end where they started, so the data points that follow are similar to those that precede the movement.
These movements affect a very small proportion of the data points, so I've just been ignoring them so far and have just used the mean of the co-ordinates to determine the location. What I'd like is a function that weights each data point according to it's similarity to the others, such that a data point during a movement would have a smaller weighting than a static point.
Is there a name for this? How is it done?
Say your data points are $(x_i)_{i=1\dots n}$. You could define
$$\mu = \frac{1}{n}\sum_{i=1}^n x_i$$
to be the unweighted mean, and then define weights
$$w_i = \frac{1}{|x_i - \mu| + \epsilon}$$
for some $\epsilon > 0$ and finally define a weighted mean by
$$\mu' = \frac{\sum_{i=1}^n w_i x_i}{\sum_{i=1}^n w_i}.$$
The $\epsilon$ appears in the denominator of the second equation so that you don't end up with infinite weights.
I should note that this is a very ad-hoc solution, though, and doesn't correspond to any statistical method I've heard of.