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.