Added new param lda_epsilon to replace the hard-coded convergence threshold used in the lda_loop function.