Weighted Least Squares Formula