Automated procedure for finding optimal tau value