https://medium.com/@monocosmo77/understanding-weighted-least-squares-part1-machine-learning-fcb1cfee72e2