weighted least squares problems