Use of weighting functions in data fitting.

Use of weighting functions in data fitting.