improve lpa and implement copra lpa.

fix estimate_stop_cond invokation bug
completely implement copra version of lpa algorithm