Markove chain imlementation and Area under ROC curve calculation