[SPARK-2839][MLlib] Stats Toolkit documentation updated

Documentation updated for the Statistics Toolkit of MLlib. @mengxr @atalwalkar

https://issues.apache.org/jira/browse/SPARK-2839
put `i++` outside the function and use `i` here