Fix code style of sample correlation
Document sample correlation
Add and use basic test for sample correlation
Update docs for code style