# Least Squares and Weighted Least Squares

I'm fine with the least squares derivation:

$e = Hx-z$

$e^2 = ||Hx-z||^2$

$\hat{x} = \text{argmin}(e^2)$

...

$\hat{x} = (H^TH)^{-1}H^Tz$

However, for the weighted least squares derivation, my notes introduce it like so:

$e^2 = ||R^{-1}(Hx-z)||^2$,

where R is the covariance matrix of of uncertainty of each measurement. Expanding like so:

$e^2 = (Hx-z)^TR^{-2}(Hx-z)$,

and minimising, I get:

$\hat{x} = (H^TR^{-2}H)^{-1}H^TR^{-2}z$,

where all the $R^{-2}$ should be $R^{-1}$ as shown here.

Where am I going wrong?

• What do you want to get? Your derivation is fine, and you got the WLS estimator. May 20, 2017 at 11:08
• I can't work out where the discrepancy between the linked notes and my derivation comes from, i.e. the power of $R$. May 20, 2017 at 16:53

There is a typo in the linked version. If $e \sim N(0, R )$., then it should be $$R^{-1/2}(Hx - z),$$ because $$Var(R^{-1/2}(Hx - z))=R^{-1/2}Var(z)R^{-1/2}= R^{-1/2}R^{1/2}R^{1/2}R^{-1/2} =I.$$