# Is a Time Series Correlated with its Future Self?

*Occasionally I may include affiliate links, which means I may get a commision if you purchase something via that link. Check out my privacy policy for more info.*

I’ve recently been studying time series analysis and was curious as to whether a time series is correlated with its future self (or past self, as the case may be). This thought came about when studying stock market prediction: the best predictor for the stock market would be a crystal ball that told you the future values.

*A Crystal Ball, or a Sports Almanac*

### Experiment

I took the opening values of the S&P100 for the final month of 2016 and correlated it to the opening *n* days later. I used Excel’s CORREL function, which computes the most traditional form of a correlation coefficient. Since this method (both in reality and in Excel) expects both variables to have the same number of values, I lost a day for each *n* days I looked into the future. Alternatively, I could’ve used January’s data.

I also created two other times series - a repeating series using Excel’s SIN (sine) function, and a completely random series using Excel’s RAND function.

### Results

As expected, the time series’ correlation coefficient to itself (0 days later) is 1. For the S&P 100 data, each day the coefficient drops by about 0.06, and the amount of decrease increases each day. The correlation coefficient for the sine wave fluctuates just as the sine wave itself does.

I didn’t include the result of the random function because it changes each time the Excel spreadsheet is updated.

days | SP100 | Sine |
---|---|---|

0 | 1.000 | 1.000 |

1 | 0.944 | 0.210 |

2 | 0.901 | -0566 |

3 | 0.834 | -0.124 |

4 | 0.730 | 0.733 |

5 | 0.623 | 0.525 |

6 | 0.466 | -0.633 |