Linear Estimation

In Linear Estimation, we are trying to estimate a random variable X\boldsymbol{X} using an observation Y\boldsymbol{Y} with a linear function of Y\boldsymbol{Y}. If Y\boldsymbol{Y} is finite dimensional, then we can say X^(Y)=WY\hat{\boldsymbol{X}}(\boldsymbol{Y}) = W\boldsymbol{Y} where WW is some matrix. Using Theorem 1 and the orthogonality principle, we know that

XWY,Y=0RXY=WRY\langle \boldsymbol{X}-W\boldsymbol{Y}, \boldsymbol{Y} \rangle = \boldsymbol{0} \Leftrightarrow R_{XY} = W\boldsymbol{R}_Y

This is known as the Normal Equation. If RYR_Y is invertible, then we can apply the inverse to find WW. Otherwise, we can apply the pseudoinverse RYR_Y^\dagger to find WW, which may not be unique. If we want to measure the quality of the estimation, since X=X+(XX^)\boldsymbol{X} = \boldsymbol{X}+(\boldsymbol{X}-\hat{\boldsymbol{X}}),

X2=X^2+XX^2    XX^2=X2X^2=RXRXYRY1RYX\begin{aligned} \|\boldsymbol{X}\|^2 &= \|\hat{\boldsymbol{X}}\|^2 + \|\boldsymbol{X} - \hat{\boldsymbol{X}}\|^2 \implies \\ \|\boldsymbol{X}-\hat{\boldsymbol{X}}\|^2 &= \|\boldsymbol{X}\|^2 - \|\hat{\boldsymbol{X}}\|^2 = R_X - R_{XY}R_Y^{-1}R_{YX}\end{aligned}

Affine Estimation

If we allow ourselves to consider an affine function for estimation X^(Y)=WY+b\hat{\boldsymbol{X}}(\boldsymbol{Y}) = W\boldsymbol{Y}+b, then this is equivalent to instead finding an estimator

X^(Y)=WY where Y=[Y1]\hat{\boldsymbol{X}}(\boldsymbol{Y}') = W\boldsymbol{Y}' \qquad \text{ where } \boldsymbol{Y}' = \begin{bmatrix} \boldsymbol{Y} \\ 1 \end{bmatrix}

This is equivalent to the following orthogonality conditions:

  1. XX^,Y\langle \boldsymbol{X}-\hat{\boldsymbol{X}}, \boldsymbol{Y} \rangle

  2. XX^,1\langle \boldsymbol{X}-\hat{\boldsymbol{X}}, 1 \rangle

Solving gives us

X^(Y)=W(YμY)+μx where WΣY=ΣXY.\hat{\boldsymbol{X}}(\boldsymbol{Y}) = W(\boldsymbol{Y}-\boldsymbol{\mu}_Y) + \mu_x \qquad \text{ where } W\Sigma_Y=\Sigma_{XY}.

ΣY\Sigma_Y and ΣXY\Sigma_{XY} are the auto-covariance and cross-covariance respectively. Recall that if

[XY]N([μXμY],[ΣXΣXYΣYXΣY])\begin{bmatrix} \boldsymbol{X} \\ \boldsymbol{Y} \end{bmatrix} \sim \mathcal{N}\left(\begin{bmatrix} \boldsymbol{\mu}_X \\ \boldsymbol{\mu}_Y \end{bmatrix}, \begin{bmatrix} \Sigma_X & \Sigma_{XY}\\ \Sigma_{YX} & \Sigma_Y \end{bmatrix}\right)

then

XYN(μX+ΣXYΣY1(YμY),ΣXΣXYΣY1ΣYX)\boldsymbol{X}|\boldsymbol{Y} \sim \mathcal{N}\left(\boldsymbol{\mu}_X + \Sigma_{XY}\Sigma_Y^{-1}(\boldsymbol{Y}-\boldsymbol{\mu}_Y), \Sigma_X-\Sigma_{XY}\Sigma_Y^{-1}\Sigma_{YX} \right)

Thus in the Joint Gaussian case, the mean of the conditional distribution is the best affine estimator of X\boldsymbol{X} using Y\boldsymbol{Y}, and the covariance is the estimation error. This has two interpretations.

  1. Under the Gaussian assumption, the best nonlinear estimator E[XY]\mathbb{E}\left[\boldsymbol{X}|\boldsymbol{Y}\right] is affine

  2. Gaussian random variables are the hardest predict because nonlinearity should improve our error, but it does not in the Gaussian case. This means if affine estimation works well, we shouldn’t try and find better non-linear estimators.

Least Squares

The theory of linear estimation is very closely connected with the theory behind least squares in linear algebra. In least squares, we have a deterministic x\boldsymbol{x} and assume nothing else about it, meaning we are looking for an unbiased estimator. Theorem 2 tells us how to find the best linear unbiased estimator in a linear setting.

Theorem 2 (Gauss Markov Theorem)

Suppose that Y=Hx+Z\boldsymbol{Y}=H\boldsymbol{x}+\boldsymbol{Z} and ZZ is zero-mean with Z,Z=I\langle \boldsymbol{Z}, \boldsymbol{Z} \rangle = \boldsymbol{I}, HH is full-column rank, then xb^=(HH)1HY\hat{\boldsymbol{x}_b} = (H^*H)^{-1}H^*\boldsymbol{Y}is the best linear unbiased estimator.

Recursive Least Squares

Suppose we extend the least squares setup to allow a stochastic, but fixed, X\boldsymbol{X} where X,X=Π0\langle \boldsymbol{X}, \boldsymbol{X} \rangle = \Pi_0. At each timestep, we receive observations of X\boldsymbol{X} such that Yi=hiX+Vi\boldsymbol{Y}_i = h_i^* \boldsymbol{X} + \boldsymbol{V}_i where Vi,Vj=δ[i,j]\langle \boldsymbol{V}_i, \boldsymbol{V}_j \rangle = \delta[i, j] and X,V\langle \boldsymbol{X}, \boldsymbol{V} \rangle . Define

Yi=[Y0Y1Yi]Hi=[h0h1hi]Vi=[V0V1Vi]\boldsymbol{Y}^i = \begin{bmatrix} \boldsymbol{Y}_0 \\ \boldsymbol{Y}_1 \\ \cdots \\ \boldsymbol{Y}_i \end{bmatrix} \qquad H_i = \begin{bmatrix} h_0^*\\ h_1^*\\ \vdots\\ h_i^*\\ \end{bmatrix} \qquad \boldsymbol{V}^i = \begin{bmatrix} \boldsymbol{V}_0 \\ \boldsymbol{V}_1 \\ \cdots \\ \boldsymbol{V}_i \end{bmatrix}

Then our setup becomes Yi=HiX+Vi\boldsymbol{Y}^i= H_i \boldsymbol{X} + \boldsymbol{V}^i.

RXYi=Π0HiRYi=(HiΠ0Hi+I)R_{XY^i} = \Pi_0 H_i^* \qquad R_{Y^i} = (H_i\Pi_0H_i^* + I)

Applying Theorem 1 and solving the normal equation, we see

W=Π0Hi(HiΠ0Hi+I)1=Π0Hi(IHi(Π01+HiHi)1Hi)=Π0(IHiHi(Π01+HiHi)1)Hi=Π0((Π01+HiHi)(HiHi)1(HiHi)(Π01+HiHi)1HiHi(Π01+HiHi)1)Hi=Π0Π01(HiHi)1HiHi(Π01+HiHi)1Hi=(Π01+HiHi)1Hi\begin{aligned} W &= \Pi_0 H_i^*(H_i\Pi_0H_i^* + I)^{-1} = \Pi_0 H_i^* (I - H_i(\Pi_0^{-1} + H_i^*H_i)^{-1}H_i^*)\\ &= \Pi_0 (I - H_i^*H_i(\Pi_0^{-1} + H_i^*H_i)^{-1})H_i^* \\ &= \Pi_0 ((\Pi_0^{-1} + H_i^*H_i)(H_i^*H_i)^{-1}(H_i^*H_i)(\Pi_0^{-1} + H_i^*H_i)^{-1}- H_i^*H_i(\Pi_0^{-1} + H_i^*H_i)^{-1})H_i^*\\ &= \Pi_0 \Pi_0^{-1}(H_i^*H_i)^{-1}H_i^*H_i(\Pi_0^{-1}+H_i^*H_i)^{-1}H_i^*\\ &= (\Pi_0^{-1} + H_i^* H_i)^{-1}H_i^*\end{aligned}

Suppose we want to do this in an online fashion where at each timestep ii, we only use the current hi,Yih_i, \boldsymbol{Y}_i and our previous estimate Xi1\boldsymbol{X}_{i-1}. Let Pi=(Π01+HiHi)1P_i = (\Pi_0^{-1} + H_i^*H_i)^{-1}. Then

Pi1=Π0+k=0ihkhk=Pi11+hihi.P_i^{-1} = \Pi_0 + \sum_{k=0}^i h_k h_k^* = P_{i-1}^{-1} + h_ih_i^*.

By applying the Sherman-Morrison-Woodbury identity, we can see that

Pi=Pi1=Pi1hihi1+hiP1hiPi1P_i = P_{i-1} = P_{i-1} \frac{h_ih_i^*}{1 + h_i^*P_{-1}h_i} P_{i-1}

Theorem 3 (Recursive Least Squares Update)

The best least squares estimate using i+1i+1 data points can be found by updating the best least squares estimate using ii data points using

X^i=X^i1+Pi1hi1+hiPi1hi(YihiX^i1)\hat{\boldsymbol{X}}_i = \hat{\boldsymbol{X}}_{i-1} + \frac{P_{i-1}h_i}{1 + h_i^*P_{i-1}h_i}(\boldsymbol{Y}_i - h_i^* \hat{\boldsymbol{X}}_{i-1})

Notice that this formula scales an innovation in order to improve the current estimate of X\boldsymbol{X}.

Just as we could compute a recursive update, we can also compute a “downdate” where we forget a particular observation. More concretely, we want to use X^i\hat{\boldsymbol{X}}_i to find X^ik\hat{\boldsymbol{X}}_{i|k}, the best linear estimator of X\boldsymbol{X} using Y0,Y1,,Yk1,Yk+1,,Yi\boldsymbol{Y}_0,\boldsymbol{Y}_1,\cdots,\boldsymbol{Y}_{k-1},\boldsymbol{Y}_{k+1},\cdots,\boldsymbol{Y}_i. Defining Pik=(Π01+HikHik)1P_{i|k} = (\Pi_0^{-1} + H_{i|k}^*H_{i|k})^{-1},

Pik1=Π01+j=0,jkihjhj=Pi1hkhk1.P_{i|k}^{-1} = \Pi_0^{-1} + \sum_{j=0,j\neq k}^i h_jh_j^* = P_i^{-1} - h_kh_k^{-1}.

Applying the Sherman-Morrison-Woodbury identity,

Pik=Pi+PihkhkhkPihk1PiP_{i|k} = P_i + P_i \frac{h_kh_k^*}{h_k^*P_ih_k - 1}P_i

Theorem 4 (Recursive Least Squares Downdate)

The best least squares estimate using all but the kth observation can be found by updating the best least squares estimate using all data points using

X^ik=X^i+PihkhkPihk1(YkhkX^i)\hat{\boldsymbol{X}}_{i|k} = \hat{X}_i + \frac{P_ih_k}{h_k^*P_ih_k - 1}(Y_k - h_k^*\hat{\boldsymbol{X}}_i)

Last updated