Update stats.py

Here is the code for the correlation function.  I was not too sure how to implement the SPECS dictionary, but I followed your other functions as an example.
Merge pull request #1 from tylyan/patch-1

Update stats.py