# random – Function to spot randomness and/or predict future data

Does Mathematica have a good function to show if a series of discrete data are random or have some hidden periodicity about them? Am I correct in thinking Fourier analysis is best suited for that. What about predictability of future data points, is there a different function for that?

Here’s an example of a data series which I tried to randomly make more predictable:

data = {11, 11, 12, 7, 14, 10, 13, 10, 11, 9, 9, 11, 7, 10, 10, 10, 9,
13, 8, 10, 12, 7, 14, 9, 11, 5, 9, 8, 11, 14, 9, 10, 6, 5, 10, 12,
10, 16, 9, 11, 9, 11, 10, 8, 14, 13, 15, 9, 14, 7, 5, 13, 9, 12, 17,
17, 14, 10, 10, 11, 9, 12, 11, 7, 10, 6, 10, 16, 12, 8, 9, 12, 10,
11, 10, 14, 8, 12, 12, 10, 7, 11, 14, 13, 9, 13, 13, 7, 13, 11, 8,
8, 8, 8, 14, 18, 16, 12, 8, 8, 7, 11, 8, 8, 14, 13, 9, 12, 12, 10,
15, 9, 12, 10, 11, 8, 8, 12, 7, 9, 10, 8, 9, 9, 11, 9, 13, 7, 11, 7,
8, 12, 8, 11, 9, 13, 7, 13, 11, 11, 8, 12, 9, 7, 14, 16, 9, 8, 11,
9, 12, 6, 12, 10, 10, 12, 4, 12, 8, 16, 11, 13, 12, 15, 8, 11, 10,
12, 11, 16, 13, 11, 5, 10, 8, 15, 12, 8, 13, 8, 12, 12, 14, 11, 8,
10, 12, 13, 10, 10, 11, 8, 12, 8, 17, 7, 16, 7, 13, 8, 11, 8, 14, 9,
7, 11, 11, 5, 13, 11, 8, 13, 10, 8, 14, 6, 14, 11, 8, 10, 12, 14,
10, 8, 13, 13, 8, 10, 14, 11, 13, 11, 10, 9, 16, 7, 14, 11, 12, 8,
11, 9, 11, 8, 9, 5, 7, 9, 17, 10, 14, 9, 12, 5, 7, 8, 12, 11, 9, 9,
12, 7, 12, 5, 10, 12, 16, 6, 11, 12, 4, 13, 4, 6, 8, 11, 10, 8, 11,
8, 6, 7, 13, 13, 9, 10, 12, 10, 13, 14, 8, 10, 7, 10, 10, 10, 12, 8,
8, 5, 10, 9, 8}

Then graph it: ListLinePlot[data]

The I try to plot the Fourier as such:

ListLinePlot[Abs[Fourier[data]], DataRange -> {1, 300}]

I notice above that frequencies of roughly 35, 130, 170, and 265 spike up. Does this tell me that the data is periodic around those frequencies? If so it means it will repeat at these periods in the future?
I notice if I use more random data, I do not even get nice peak frequencies at all.

Does Mathematica have a better way of doing this? I don’t think I could have used that function in a more efficient way, or are there better ones to use? Am I supposed to use TimeSeriesForecast[], or Predict[], or others? If so, can you show me with example how to do this.