estimate function

Optimization for wls method