Suppose some people I know frequently have meetings, and suppose I want to find out whether there's a pattern to when these meetings take place, and if so how often they occur.
I can take note of the days when they have meetings. If I assume that the first meeting took place on Day 0, then I might end up with a list of days like
$$[0, 14, 27, 41, 55, 70, 84, 91, 105, 112, 126],$$
meaning they also met up on Day 14, Day 27, etc. If I look at the gaps between the numbers, then I get
$$[14, 13, 14, 14, 15, 14, 7, 14, 7, 14],$$
which indicates to me that they probably have meetings every one or two weeks, most likely two.
If we suppose the list of days looked like this instead:
$$[0, 100, 162, 257, 339, 416, 434, 440, 443, 538, 549],$$
with gaps
$$[100, 62, 95, 82, 77, 18, 6, 3, 95, 11],$$
then I don't see much of a pattern there, and I'd assume that they meet up at random.
So my question is this: Is there a good way of detecting whether there's a pattern to the days, and if so find out what the most likely frequency is? (e.g. 14 days for the first example)
I tried guessing the frequency then checking how well it fits by sum of squared differences, but this turned out to be sensitive to outliers. This is a problem because we might have gaps like this:
$$[7, 7, 7, 6, 84, 7, 7, 6, 7],$$
which indicates to me that the meetings take place every week, but they also took a three month break in between.
You might try looking for peaks in the discrete Fourier transform of $X$ where $X(i) = 1$ if there is a meeting on day i$, $0$ otherwise.