Fitting a noisy and incomplete arithmetic progression

29 Views Asked by At

I have a sequence of numbers that I know they belong to an arithmetic progression. I do not know the value of offset ($b$), the difference between consecutive numbers $\Delta$, nor the actual position within the sequence ($n$).

So, my sequence is:

$ {x_1, x_2, ...., x_N} $

where each element $x_i$ is

$ x_i = b + n_i \Delta $

and I need to find $b$, $\Delta$ and $n_i$.

Values can repeat or be missing.

I calculated all differences between the elements and then found the Greatest common divisor. From there I got the rest.

The problem that I am having is that my sequences has noise, i.e.

$ x_i = b + n_i \Delta + R_i$

where R is a random number (much smaller than $x_i$ but not negligible). So finding the GCD fails. Any ideas on how to approach this?