iwls_1d function

Iterative Weighted Least Squares algorithm for 1ts model