Determine most likely "divisor"

35 Views Asked by At

Given a sequence of samples $S$ I'd like to find $k$ given that most of the samples are known to be $h/k+\delta$ ($h$: random integer $[0,k]$, $\delta$: random noise). Unfortunately, I'm having trouble to come up with the right search terms to find a solution. Are there any approaches to find $k$?

Example (Python)

import random
k = 5
samples = [random.randint(0, k) / k + 0.01 * (random.random() - 0.5) for _ in range(100)]
samples += [random.random() for _ in range(10)] # outliers
random.shuffle(samples)
print(samples)

Update

In the meantime, I tried to interpret the samples as frequencies $f_i = S_i*f_k$ where $f_k = \frac{1}{k}$. However, I haven't been able to come up with a way to go further (Fourier transform?).