Estimation method that minimizes the mean square error
In statistics and signal processing, a minimum mean square error (MMSE) estimator is an estimation method which minimizes the mean square error (MSE), which is a common measure of estimator quality, of the fitted values of a dependent variable. In the Bayesian setting, the term MMSE more specifically refers to estimation with quadratic loss function. In such case, the MMSE estimator is given by the posterior mean of the parameter to be estimated. Since the posterior mean is cumbersome to calculate, the form of the MMSE estimator is usually constrained to be within a certain class of functions. Linear MMSE estimators are a popular choice since they are easy to use, easy to calculate, and very versatile. It has given rise to many popular estimators such as the Wiener–Kolmogorov filter and Kalman filter.
Motivation
The term MMSE more specifically refers to estimation in a Bayesian setting with quadratic cost function. The basic idea behind the Bayesian approach to estimation stems from practical situations where we often have some prior information about the parameter to be estimated. For instance, we may have prior information about the range that the parameter can assume; or we may have an old estimate of the parameter that we want to modify when a new observation is made available; or the statistics of an actual random signal such as speech. This is in contrast to the non-Bayesian approach like minimum-variance unbiased estimator (MVUE) where absolutely nothing is assumed to be known about the parameter in advance and which does not account for such situations. In the Bayesian approach, such prior information is captured by the prior probability density function of the parameters; and based directly on Bayes theorem, it allows us to make better posterior estimates as more observations become available. Thus unlike non-Bayesian approach where parameters of interest are assumed to be deterministic, but unknown constants, the Bayesian estimator seeks to estimate a parameter that is itself a random variable. Furthermore, Bayesian estimation can also deal with situations where the sequence of observations are not necessarily independent. Thus Bayesian estimation provides yet another alternative to the MVUE. This is useful when the MVUE does not exist or cannot be found.
Definition
Let
be a
hidden random vector variable, and let
be a
known random vector variable (the measurement or observation), both of them not necessarily of the same dimension. An estimator
of
is any function of the measurement
. The estimation error vector is given by
and its mean squared error (MSE) is given by the trace of error covariance matrix
![{\displaystyle \operatorname {MSE} =\operatorname {tr} \left\{\operatorname {E} \{({\hat {x}}-x)({\hat {x}}-x)^{T}\}\right\}=\operatorname {E} \{({\hat {x}}-x)^{T}({\hat {x}}-x)\},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/cc582ac2e1235ab6e4b0107035bade98be89d361)
where the expectation
is taken over
conditioned on
. When
is a scalar variable, the MSE expression simplifies to
. Note that MSE can equivalently be defined in other ways, since
![{\displaystyle \operatorname {tr} \left\{\operatorname {E} \{ee^{T}\}\right\}=\operatorname {E} \left\{\operatorname {tr} \{ee^{T}\}\right\}=\operatorname {E} \{e^{T}e\}=\sum _{i=1}^{n}\operatorname {E} \{e_{i}^{2}\}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1a2f5893a9ee29f9179e98329454acdfe19ab9b8)
The MMSE estimator is then defined as the estimator achieving minimal MSE:
![{\displaystyle {\hat {x}}_{\operatorname {MMSE} }(y)=\operatorname {argmin} _{\hat {x}}\operatorname {MSE} .}](https://wikimedia.org/api/rest_v1/media/math/render/svg/87f0b719c3f8b6d6afdd112a57c0cfeaaf8d492f)
Properties
- When the means and variances are finite, the MMSE estimator is uniquely defined[1] and is given by:
![{\displaystyle {\hat {x}}_{\operatorname {MMSE} }(y)=\operatorname {E} \{x\mid y\}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/685de9a65116c5280d8161ffd2ee77f2d5918985)
- In other words, the MMSE estimator is the conditional expectation of
given the known observed value of the measurements. Also, since
is the posterior mean, the error covariance matrix
is equal to the posterior covariance
matrix,
.
- The MMSE estimator is unbiased (under the regularity assumptions mentioned above):
![{\displaystyle \operatorname {E} \{{\hat {x}}_{\operatorname {MMSE} }(y)\}=\operatorname {E} \{\operatorname {E} \{x\mid y\}\}=\operatorname {E} \{x\}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8484d5d17eb8a37538bbb132b3ef529561fc37b6)
- The MMSE estimator is asymptotically unbiased and it converges in distribution to the normal distribution:
![{\displaystyle {\sqrt {n}}({\hat {x}}_{\operatorname {MMSE} }-x)\xrightarrow {d} {\mathcal {N}}\left(0,I^{-1}(x)\right),}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3bd8714d6198fc986e3f3819b8e75c16a5eb2482)
- where
is the Fisher information of
. Thus, the MMSE estimator is asymptotically efficient.
- The orthogonality principle: When
is a scalar, an estimator constrained to be of certain form
is an optimal estimator, i.e.
if and only if
![{\displaystyle \operatorname {E} \{({\hat {x}}_{\operatorname {MMSE} }-x)g(y)\}=0}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d316dc6cc4add3420eb08a4d29e612fcf8e93c75)
- for all
in closed, linear subspace
of the measurements. For random vectors, since the MSE for estimation of a random vector is the sum of the MSEs of the coordinates, finding the MMSE estimator of a random vector decomposes into finding the MMSE estimators of the coordinates of X separately: ![{\displaystyle \operatorname {E} \{(g_{i}^{*}(y)-x_{i})g_{j}(y)\}=0,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/51aca9f34fa6de199a7bd55f47f11916292e1bc8)
- for all i and j. More succinctly put, the cross-correlation between the minimum estimation error
and the estimator
should be zero, ![{\displaystyle \operatorname {E} \{({\hat {x}}_{\operatorname {MMSE} }-x){\hat {x}}^{T}\}=0.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/76dd21a7cb9ef2ee1c81fcaaee066cd87ef322e4)
- If
and
are jointly Gaussian, then the MMSE estimator is linear, i.e., it has the form
for matrix
and constant
. This can be directly shown using the Bayes theorem. As a consequence, to find the MMSE estimator, it is sufficient to find the linear MMSE estimator.
Linear MMSE estimator
In many cases, it is not possible to determine the analytical expression of the MMSE estimator. Two basic numerical approaches to obtain the MMSE estimate depends on either finding the conditional expectation
or finding the minima of MSE. Direct numerical evaluation of the conditional expectation is computationally expensive since it often requires multidimensional integration usually done via Monte Carlo methods. Another computational approach is to directly seek the minima of the MSE using techniques such as the stochastic gradient descent methods; but this method still requires the evaluation of expectation. While these numerical methods have been fruitful, a closed form expression for the MMSE estimator is nevertheless possible if we are willing to make some compromises.
One possibility is to abandon the full optimality requirements and seek a technique minimizing the MSE within a particular class of estimators, such as the class of linear estimators. Thus, we postulate that the conditional expectation of
given
is a simple linear function of
,
, where the measurement
is a random vector,
is a matrix and
is a vector. This can be seen as the first order Taylor approximation of
. The linear MMSE estimator is the estimator achieving minimum MSE among all estimators of such form. That is, it solves the following optimization problem:
![{\displaystyle \min _{W,b}\operatorname {MSE} \qquad {\text{s.t.}}\qquad {\hat {x}}=Wy+b.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5f954ebf4a1072b7e7a138ab8cca1e3bf262166a)
One advantage of such linear MMSE estimator is that it is not necessary to explicitly calculate the posterior probability density function of
. Such linear estimator only depends on the first two moments of
and
. So although it may be convenient to assume that
and
are jointly Gaussian, it is not necessary to make this assumption, so long as the assumed distribution has well defined first and second moments. The form of the linear estimator does not depend on the type of the assumed underlying distribution.
The expression for optimal
and
is given by:
![{\displaystyle b={\bar {x}}-W{\bar {y}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e4882f003d25c7d8792d10e46f9a9bdf64785f3d)
![{\displaystyle W=C_{XY}C_{Y}^{-1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec0c38d08970d3adfa78ce32071ecd37582ebc26)
where
,
the
is cross-covariance matrix between
and
, the
is auto-covariance matrix of
.
Thus, the expression for linear MMSE estimator, its mean, and its auto-covariance is given by
![{\displaystyle {\hat {x}}=C_{XY}C_{Y}^{-1}(y-{\bar {y}})+{\bar {x}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a76f947436fa31b0191c1644736fe4e0b97c5f8a)
![{\displaystyle \operatorname {E} \{{\hat {x}}\}={\bar {x}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2e530cab2ecc59aeaffc6a834c7e34e34137023d)
![{\displaystyle C_{\hat {X}}=C_{XY}C_{Y}^{-1}C_{YX},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c8a1bd0fff5e0a5b1c624629126c7348416d0d6b)
where the
is cross-covariance matrix between
and
.
Lastly, the error covariance and minimum mean square error achievable by such estimator is
![{\displaystyle C_{e}=C_{X}-C_{\hat {X}}=C_{X}-C_{XY}C_{Y}^{-1}C_{YX},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c751be84080bb04b67665b4444f21b5140ff38d7)
![{\displaystyle \operatorname {LMMSE} =\operatorname {tr} \{C_{e}\}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/874f7ba8b77533488a2f8386beece20138275f7a)
Derivation using orthogonality principle
Let us have the optimal linear MMSE estimator given as
, where we are required to find the expression for
and
. It is required that the MMSE estimator be unbiased. This means,
![{\displaystyle \operatorname {E} \{{\hat {x}}\}=\operatorname {E} \{x\}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/eb34a6d0f00ebee6aaaa64d535b79f9b967dcd73)
Plugging the expression for
in above, we get
![{\displaystyle b={\bar {x}}-W{\bar {y}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e4882f003d25c7d8792d10e46f9a9bdf64785f3d)
where
and
. Thus we can re-write the estimator as
![{\displaystyle {\hat {x}}=W(y-{\bar {y}})+{\bar {x}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec1efef7c2a061834251701433ca5b25a806a5de)
and the expression for estimation error becomes
![{\displaystyle {\hat {x}}-x=W(y-{\bar {y}})-(x-{\bar {x}}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fa5f85f3aa87ff507753972f0de222bdeefb5637)
From the orthogonality principle, we can have
, where we take
. Here the left-hand-side term is
![{\displaystyle {\begin{aligned}\operatorname {E} \{({\hat {x}}-x)(y-{\bar {y}})^{T}\}&=\operatorname {E} \{(W(y-{\bar {y}})-(x-{\bar {x}}))(y-{\bar {y}})^{T}\}\\&=W\operatorname {E} \{(y-{\bar {y}})(y-{\bar {y}})^{T}\}-\operatorname {E} \{(x-{\bar {x}})(y-{\bar {y}})^{T}\}\\&=WC_{Y}-C_{XY}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e0f902090f6455592d4c1c4e16a8916e0c06b6b)
When equated to zero, we obtain the desired expression for
as
![{\displaystyle W=C_{XY}C_{Y}^{-1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec0c38d08970d3adfa78ce32071ecd37582ebc26)
The
is cross-covariance matrix between X and Y, and
is auto-covariance matrix of Y. Since
, the expression can also be re-written in terms of
as
![{\displaystyle W^{T}=C_{Y}^{-1}C_{YX}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/78edf7eb720f2dfa29af662bffd3b5d7eccfcf64)
Thus the full expression for the linear MMSE estimator is
![{\displaystyle {\hat {x}}=C_{XY}C_{Y}^{-1}(y-{\bar {y}})+{\bar {x}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7191bfeeabc35b0bbcb014687e6fa74c4dca25dd)
Since the estimate
is itself a random variable with
, we can also obtain its auto-covariance as
![{\displaystyle {\begin{aligned}C_{\hat {X}}&=\operatorname {E} \{({\hat {x}}-{\bar {x}})({\hat {x}}-{\bar {x}})^{T}\}\\&=W\operatorname {E} \{(y-{\bar {y}})(y-{\bar {y}})^{T}\}W^{T}\\&=WC_{Y}W^{T}.\\\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f8d2df37499c1c635cf3960e8aa45b096e733c28)
Putting the expression for
and
, we get
![{\displaystyle C_{\hat {X}}=C_{XY}C_{Y}^{-1}C_{YX}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/cf35fc2b08e14422d0cc299fea1e9d920e49a197)
Lastly, the covariance of linear MMSE estimation error will then be given by
![{\displaystyle {\begin{aligned}C_{e}&=\operatorname {E} \{({\hat {x}}-x)({\hat {x}}-x)^{T}\}\\&=\operatorname {E} \{({\hat {x}}-x)(W(y-{\bar {y}})-(x-{\bar {x}}))^{T}\}\\&=\underbrace {\operatorname {E} \{({\hat {x}}-x)(y-{\bar {y}})^{T}\}} _{0}W^{T}-\operatorname {E} \{({\hat {x}}-x)(x-{\bar {x}})^{T}\}\\&=-\operatorname {E} \{(W(y-{\bar {y}})-(x-{\bar {x}}))(x-{\bar {x}})^{T}\}\\&=\operatorname {E} \{(x-{\bar {x}})(x-{\bar {x}})^{T}\}-W\operatorname {E} \{(y-{\bar {y}})(x-{\bar {x}})^{T}\}\\&=C_{X}-WC_{YX}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2c6167d587cf0b6b3dd29512520a41b2b6a0ed21)
The first term in the third line is zero due to the orthogonality principle. Since
, we can re-write
in terms of covariance matrices as
![{\displaystyle C_{e}=C_{X}-C_{XY}C_{Y}^{-1}C_{YX}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/931745ad346b49682fae98bdf95080088d7be5e0)
This we can recognize to be the same as
Thus the minimum mean square error achievable by such a linear estimator is
.
Univariate case
For the special case when both
and
are scalars, the above relations simplify to
![{\displaystyle {\hat {x}}={\frac {\sigma _{XY}}{\sigma _{Y}^{2}}}(y-{\bar {y}})+{\bar {x}}=\rho {\frac {\sigma _{X}}{\sigma _{Y}}}(y-{\bar {y}})+{\bar {x}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/744bdede7b69761cce5c4dea085d1c093d46f908)
![{\displaystyle \sigma _{e}^{2}=\sigma _{X}^{2}-{\frac {\sigma _{XY}^{2}}{\sigma _{Y}^{2}}}=(1-\rho ^{2})\sigma _{X}^{2},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ddad34da962d063386bd8ddec78f6f5c6d8091a0)
where
is the Pearson's correlation coefficient between
and
.
The above two equations allows us to interpret the correlation coefficient either as normalized slope of linear regression
![{\displaystyle \left({\frac {{\hat {x}}-{\bar {x}}}{\sigma _{X}}}\right)=\rho \left({\frac {y-{\bar {y}}}{\sigma _{Y}}}\right)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a45d63565b379386378b287185cd796574ec4469)
or as square root of the ratio of two variances
.
When
, we have
and
. In this case, no new information is gleaned from the measurement which can decrease the uncertainty in
. On the other hand, when
, we have
and
. Here
is completely determined by
, as given by the equation of straight line.
Computation
Standard method like Gauss elimination can be used to solve the matrix equation for
. A more numerically stable method is provided by QR decomposition method. Since the matrix
is a symmetric positive definite matrix,
can be solved twice as fast with the Cholesky decomposition, while for large sparse systems conjugate gradient method is more effective. Levinson recursion is a fast method when
is also a Toeplitz matrix. This can happen when
is a wide sense stationary process. In such stationary cases, these estimators are also referred to as Wiener–Kolmogorov filters.
Linear MMSE estimator for linear observation process
Let us further model the underlying process of observation as a linear process:
, where
is a known matrix and
is random noise vector with the mean
and cross-covariance
. Here the required mean and the covariance matrices will be
![{\displaystyle \operatorname {E} \{y\}=A{\bar {x}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8b3559e85e982c933eaca4d0014c81f4b0dc95ef)
![{\displaystyle C_{Y}=AC_{X}A^{T}+C_{Z},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/17b5267260afa86a77ea3f9d12bb71d7962c020a)
![{\displaystyle C_{XY}=C_{X}A^{T}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3f27b04db486754509b5d5c4addc11e0ffe89ddc)
Thus the expression for the linear MMSE estimator matrix
further modifies to
![{\displaystyle W=C_{X}A^{T}(AC_{X}A^{T}+C_{Z})^{-1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b15376f66867a5f658334598152dee79df27aabe)
Putting everything into the expression for
, we get
![{\displaystyle {\hat {x}}=C_{X}A^{T}(AC_{X}A^{T}+C_{Z})^{-1}(y-A{\bar {x}})+{\bar {x}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/040d2bf5d278d33f0ce29b6bb7d496abec3de5fa)
Lastly, the error covariance is
![{\displaystyle C_{e}=C_{X}-C_{\hat {X}}=C_{X}-C_{X}A^{T}(AC_{X}A^{T}+C_{Z})^{-1}AC_{X}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f8548ae241bf6639805dbc933a7464a8c6f259e3)
The significant difference between the estimation problem treated above and those of least squares and Gauss–Markov estimate is that the number of observations m, (i.e. the dimension of
) need not be at least as large as the number of unknowns, n, (i.e. the dimension of
). The estimate for the linear observation process exists so long as the m-by-m matrix
exists; this is the case for any m if, for instance,
is positive definite. Physically the reason for this property is that since
is now a random variable, it is possible to form a meaningful estimate (namely its mean) even with no measurements. Every new measurement simply provides additional information which may modify our original estimate. Another feature of this estimate is that for m < n, there need be no measurement error. Thus, we may have
, because as long as
is positive definite, the estimate still exists. Lastly, this technique can handle cases where the noise is correlated.
An alternative form of expression can be obtained by using the matrix identity
![{\displaystyle C_{X}A^{T}(AC_{X}A^{T}+C_{Z})^{-1}=(A^{T}C_{Z}^{-1}A+C_{X}^{-1})^{-1}A^{T}C_{Z}^{-1},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3c1d11085319f7cd4a56190bea718451d0eb01e0)
which can be established by post-multiplying by
and pre-multiplying by
to obtain
![{\displaystyle W=(A^{T}C_{Z}^{-1}A+C_{X}^{-1})^{-1}A^{T}C_{Z}^{-1},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/32171df2620c0f0c11c950faaaad0e3ecc29adb0)
and
![{\displaystyle C_{e}=(A^{T}C_{Z}^{-1}A+C_{X}^{-1})^{-1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b5cc0ef2256b42cdd85796ae1764f89c3f76ce2c)
Since
can now be written in terms of
as
, we get a simplified expression for
as
![{\displaystyle {\hat {x}}=C_{e}A^{T}C_{Z}^{-1}(y-A{\bar {x}})+{\bar {x}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b402262acbb510f9831777ad88a549418fcd5f17)
In this form the above expression can be easily compared with ridge regression, weighed least square and Gauss–Markov estimate. In particular, when
, corresponding to infinite variance of the apriori information concerning
, the result
is identical to the weighed linear least square estimate with
as the weight matrix. Moreover, if the components of
are uncorrelated and have equal variance such that
where
is an identity matrix, then
is identical to the ordinary least square estimate. When apriori information is available as
and the
are uncorrelated and have equal variance, we have
, which is identical to ridge regression solution.
Sequential linear MMSE estimation
In many real-time applications, observational data is not available in a single batch. Instead the observations are made in a sequence. One possible approach is to use the sequential observations to update an old estimate as additional data becomes available, leading to finer estimates. One crucial difference between batch estimation and sequential estimation is that sequential estimation requires an additional Markov assumption.
In the Bayesian framework, such recursive estimation is easily facilitated using Bayes' rule. Given
observations,
, Bayes' rule gives us the posterior density of
as
![{\displaystyle {\begin{aligned}p(x_{k}|y_{1},\ldots ,y_{k})&\propto p(y_{k}|x,y_{1},\ldots ,y_{k-1})p(x_{k}|y_{1},\ldots ,y_{k-1})\\&=p(y_{k}|x_{k})p(x_{k}|y_{1},\ldots ,y_{k-1}).\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a28d281c371d46cfde071476cb6b8ffcab51e28a)
The
is called the posterior density,
is called the likelihood function, and
is the prior density of k-th time step. Here we have assumed the conditional independence of
from previous observations
given
as
![{\displaystyle p(y_{k}|x_{k},y_{1},\ldots ,y_{k-1})=p(y_{k}|x_{k}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d06c6ba54af43cf3f1f16e4bfea7660db895cc55)
This is the Markov assumption.
The MMSE estimate
given the k-th observation is then the mean of the posterior density
. With the lack of dynamical information on how the state
changes with time, we will make a further stationarity assumption about the prior:
![{\displaystyle p(x_{k}|y_{1},\ldots ,y_{k-1})=p(x_{k-1}|y_{1},\ldots ,y_{k-1}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/535f55644325c871ca72e1cc9ba83bf2d7c66b18)
Thus, the prior density for k-th time step is the posterior density of (k-1)-th time step. This structure allows us to formulate a recursive approach to estimation.
In the context of linear MMSE estimator, the formula for the estimate will have the same form as before:
However, the mean and covariance matrices of
and
will need to be replaced by those of the prior density
and likelihood
, respectively.
For the prior density
, its mean is given by the previous MMSE estimate,
,
and its covariance matrix is given by the previous error covariance matrix,
![{\displaystyle C_{X_{k}|Y_{1},\ldots ,Y_{k-1}}=C_{X_{k-1}|Y_{1},\ldots ,Y_{k-1}}=C_{e_{k-1}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e758bf88de9800177a1ffa89b8c32df0383bc802)
as per by the properties of MMSE estimators and the stationarity assumption.
Similarly, for the linear observation process, the mean of the likelihood
is given by
and the covariance matrix is as before
.
The difference between the predicted value of
, as given by
, and its observed value
gives the prediction error
, which is also referred to as innovation or residual. It is more convenient to represent the linear MMSE in terms of the prediction error, whose mean and covariance are
and
.
Hence, in the estimate update formula, we should replace
and
by
and
, respectively. Also, we should replace
and
by
and
. Lastly, we replace
by
![{\displaystyle {\begin{aligned}C_{X_{k}Y_{k}|Y_{1},\ldots ,Y_{k-1}}&=C_{e_{k-1}{\tilde {Y}}_{k}}=C_{e_{k-1}}A^{T}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b5d26e03a10df0428442e7877af87fe2b2d6d65f)
Thus, we have the new estimate as new observation
arrives as
![{\displaystyle {\begin{aligned}{\hat {x}}_{k}&={\hat {x}}_{k-1}+C_{e_{k-1}{\tilde {Y}}_{k}}C_{{\tilde {Y}}_{k}}^{-1}(y_{k}-{\bar {y}}_{k})\\&={\hat {x}}_{k-1}+C_{e_{k-1}}A^{T}(AC_{e_{k-1}}A^{T}+C_{Z})^{-1}(y_{k}-A{\hat {x}}_{k-1})\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/00c116bb1f74809832e9d7503074bb155b578957)
and the new error covariance as
![{\displaystyle C_{e_{k}}=C_{e_{k-1}}-C_{e_{k-1}}A^{T}(AC_{e_{k-1}}A^{T}+C_{Z})^{-1}AC_{e_{k-1}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ea91b8c5003583af47e70c4972723f78f1c1c4dd)
From the point of view of linear algebra, for sequential estimation, if we have an estimate
based on measurements generating space
, then after receiving another set of measurements, we should subtract out from these measurements that part that could be anticipated from the result of the first measurements. In other words, the updating must be based on that part of the new data which is orthogonal to the old data.
The repeated use of the above two equations as more observations become available lead to recursive estimation techniques. The expressions can be more compactly written as
![{\displaystyle W_{k}=C_{e_{k-1}}A^{T}(AC_{e_{k-1}}A^{T}+C_{Z})^{-1},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ba4a17040b1d145150e1076636da41460d76132b)
![{\displaystyle {\hat {x}}_{k}={\hat {x}}_{k-1}+W_{k}(y_{k}-A{\hat {x}}_{k-1}),}](https://wikimedia.org/api/rest_v1/media/math/render/svg/561f3629f8db54132ce1c94d9c1053df10979c26)
![{\displaystyle C_{e_{k}}=(I-W_{k}A)C_{e_{k-1}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7e992c4b2fac070830c01fc9a96ed78907e6fbbe)
The matrix
is often referred to as the Kalman gain factor. The alternative formulation of the above algorithm will give
![{\displaystyle C_{e_{k}}^{-1}=C_{e_{k-1}}^{-1}+A^{T}C_{Z}^{-1}A,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/314bb74c4dd2dabf0767bfea13b346d1fd4ef534)
![{\displaystyle W_{k}=C_{e_{k}}A^{T}C_{Z}^{-1},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1bca09a0790840ae031b1f2fbe21741886f13f61)
![{\displaystyle {\hat {x}}_{k}={\hat {x}}_{k-1}+W_{k}(y_{k}-A{\hat {x}}_{k-1}),}](https://wikimedia.org/api/rest_v1/media/math/render/svg/561f3629f8db54132ce1c94d9c1053df10979c26)
The repetition of these three steps as more data becomes available leads to an iterative estimation algorithm. The generalization of this idea to non-stationary cases gives rise to the Kalman filter. The three update steps outlined above indeed form the update step of the Kalman filter.
Special case: scalar observations
As an important special case, an easy to use recursive expression can be derived when at each k-th time instant the underlying linear observation process yields a scalar such that
, where
is n-by-1 known column vector whose values can change with time,
is n-by-1 random column vector to be estimated, and
is scalar noise term with variance
. After (k+1)-th observation, the direct use of above recursive equations give the expression for the estimate
as:
![{\displaystyle {\hat {x}}_{k+1}={\hat {x}}_{k}+w_{k+1}(y_{k+1}-a_{k+1}^{T}{\hat {x}}_{k})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/806c4bdc22140d6354201407ef7af7d4f19bd243)
where
is the new scalar observation and the gain factor
is n-by-1 column vector given by
![{\displaystyle w_{k+1}={\frac {C_{e_{k}}a_{k+1}}{\sigma _{k+1}^{2}+a_{k+1}^{T}C_{e_{k}}a_{k+1}}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1793dc909e8bd32de6177373c5d4f018c08f97af)
The
is n-by-n error covariance matrix given by
![{\displaystyle C_{e_{k+1}}=(I-w_{k+1}a_{k+1}^{T})C_{e_{k}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fc79c70ea6df972ce8de6314f2ea9411c816d3fb)
Here, no matrix inversion is required. Also, the gain factor,
, depends on our confidence in the new data sample, as measured by the noise variance, versus that in the previous data. The initial values of
and
are taken to be the mean and covariance of the aprior probability density function of
.
Alternative approaches: This important special case has also given rise to many other iterative methods (or adaptive filters), such as the least mean squares filter and recursive least squares filter, that directly solves the original MSE optimization problem using stochastic gradient descents. However, since the estimation error
cannot be directly observed, these methods try to minimize the mean squared prediction error
. For instance, in the case of scalar observations, we have the gradient
Thus, the update equation for the least mean square filter is given by
![{\displaystyle {\hat {x}}_{k+1}={\hat {x}}_{k}+\eta _{k}\mathrm {E} \{{\tilde {y}}_{k}a_{k}\},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0c0b77793ef82a3a838cd2b10e6dfc56a105f289)
where
is the scalar step size and the expectation is approximated by the instantaneous value
. As we can see, these methods bypass the need for covariance matrices.
In many practical applications, the observation noise is uncorrelated. That is,
is a diagonal matrix. In such cases, it is advantageous to consider the components of
as independent scalar measurements, rather than vector measurement. This allows us to reduce computation time by processing the
measurement vector as
scalar measurements. The use of scalar update formula avoids matrix inversion in the implementation of the covariance update equations, thus improving the numerical robustness against roundoff errors. The update can be implemented iteratively as:
![{\displaystyle w_{k+1}^{(\ell )}={\frac {C_{e_{k}}^{(\ell )}A_{k+1}^{(\ell )T}}{C_{Z_{k+1}}^{(\ell )}+A_{k+1}^{(\ell )}C_{e_{k}}^{(\ell )}(A_{k+1}^{(\ell )T})}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/efa2de6e8ba3735c67c4f3e033f344f506d842eb)
![{\displaystyle C_{e_{k+1}}^{(\ell )}=(I-w_{k+1}^{(\ell )}A_{k+1}^{(\ell )})C_{e_{k}}^{(\ell )}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2a7c5dccc972708e339974af687f40bfff0a2718)
![{\displaystyle {\hat {x}}_{k+1}^{(\ell )}={\hat {x}}_{k}^{(\ell -1)}+w_{k+1}^{(\ell )}(y_{k+1}^{(\ell )}-A_{k+1}^{(\ell )}{\hat {x}}_{k}^{(\ell -1)})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/50185b243af791f863ed76592ac3513a04e0af80)
where
, using the initial values
and
. The intermediate variables
is the
-th diagonal element of the
diagonal matrix
; while
is the
-th row of
matrix
. The final values are
and
.
Examples
Example 1
We shall take a linear prediction problem as an example. Let a linear combination of observed scalar random variables
and
be used to estimate another future scalar random variable
such that
. If the random variables
are real Gaussian random variables with zero mean and its covariance matrix given by
![{\displaystyle \operatorname {cov} (Z)=\operatorname {E} [zz^{T}]=\left[{\begin{array}{cccc}1&2&3&4\\2&5&8&9\\3&8&6&10\\4&9&10&15\end{array}}\right],}](https://wikimedia.org/api/rest_v1/media/math/render/svg/90889a9de7192d317decb8381ca25cda49892b5c)
then our task is to find the coefficients
such that it will yield an optimal linear estimate
.
In terms of the terminology developed in the previous sections, for this problem we have the observation vector
, the estimator matrix
as a row vector, and the estimated variable
as a scalar quantity. The autocorrelation matrix
is defined as
![{\displaystyle C_{Y}=\left[{\begin{array}{ccc}E[z_{1},z_{1}]&E[z_{2},z_{1}]&E[z_{3},z_{1}]\\E[z_{1},z_{2}]&E[z_{2},z_{2}]&E[z_{3},z_{2}]\\E[z_{1},z_{3}]&E[z_{2},z_{3}]&E[z_{3},z_{3}]\end{array}}\right]=\left[{\begin{array}{ccc}1&2&3\\2&5&8\\3&8&6\end{array}}\right].}](https://wikimedia.org/api/rest_v1/media/math/render/svg/50c0831c4af6cc131c13cd4da73e21ee08aac40c)
The cross correlation matrix
is defined as
![{\displaystyle C_{YX}=\left[{\begin{array}{c}E[z_{4},z_{1}]\\E[z_{4},z_{2}]\\E[z_{4},z_{3}]\end{array}}\right]=\left[{\begin{array}{c}4\\9\\10\end{array}}\right].}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e0b4e00619f85de1c0967817d68b6b154557af03)
We now solve the equation
by inverting
and pre-multiplying to get
![{\displaystyle C_{Y}^{-1}C_{YX}=\left[{\begin{array}{ccc}4.85&-1.71&-0.142\\-1.71&0.428&0.2857\\-0.142&0.2857&-0.1429\end{array}}\right]\left[{\begin{array}{c}4\\9\\10\end{array}}\right]=\left[{\begin{array}{c}2.57\\-0.142\\0.5714\end{array}}\right]=W^{T}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8f29d9505d5f630feae8a4566c23bae8dd82fd5d)
So we have
and
as the optimal coefficients for
. Computing the minimum mean square error then gives
.[2] Note that it is not necessary to obtain an explicit matrix inverse of
to compute the value of
. The matrix equation can be solved by well known methods such as Gauss elimination method. A shorter, non-numerical example can be found in orthogonality principle.
Example 2
Consider a vector
formed by taking
observations of a fixed but unknown scalar parameter
disturbed by white Gaussian noise. We can describe the process by a linear equation
, where
. Depending on context it will be clear if
represents a scalar or a vector. Suppose that we know
to be the range within which the value of
is going to fall in. We can model our uncertainty of
by an aprior uniform distribution over an interval
, and thus
will have variance of
. Let the noise vector
be normally distributed as
where
is an identity matrix. Also
and
are independent and
. It is easy to see that
![{\displaystyle {\begin{aligned}&\operatorname {E} \{y\}=0,\\&C_{Y}=\operatorname {E} \{yy^{T}\}=\sigma _{X}^{2}11^{T}+\sigma _{Z}^{2}I,\\&C_{XY}=\operatorname {E} \{xy^{T}\}=\sigma _{X}^{2}1^{T}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7f24d11936cad302b110aad042de1a4427c2539c)
Thus, the linear MMSE estimator is given by
![{\displaystyle {\begin{aligned}{\hat {x}}&=C_{XY}C_{Y}^{-1}y\\&=\sigma _{X}^{2}1^{T}(\sigma _{X}^{2}11^{T}+\sigma _{Z}^{2}I)^{-1}y.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e3e139cd80094685323d01b521bf08dcc41ecfef)
We can simplify the expression by using the alternative form for
as
![{\displaystyle {\begin{aligned}{\hat {x}}&=\left(1^{T}{\frac {1}{\sigma _{Z}^{2}}}I1+{\frac {1}{\sigma _{X}^{2}}}\right)^{-1}1^{T}{\frac {1}{\sigma _{Z}^{2}}}Iy\\&={\frac {1}{\sigma _{Z}^{2}}}\left({\frac {N}{\sigma _{Z}^{2}}}+{\frac {1}{\sigma _{X}^{2}}}\right)^{-1}1^{T}y\\&={\frac {\sigma _{X}^{2}}{\sigma _{X}^{2}+\sigma _{Z}^{2}/N}}{\bar {y}},\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6618cf0ac9e7ae8c333b2bf61b74aa5db909698a)
where for
we have
Similarly, the variance of the estimator is
![{\displaystyle \sigma _{\hat {X}}^{2}=C_{XY}C_{Y}^{-1}C_{YX}={\Big (}{\frac {\sigma _{X}^{2}}{\sigma _{X}^{2}+\sigma _{Z}^{2}/N}}{\Big )}\sigma _{X}^{2}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f7e95e71c53d94de8bcbd801012303635595878c)
Thus the MMSE of this linear estimator is
![{\displaystyle \operatorname {LMMSE} =\sigma _{X}^{2}-\sigma _{\hat {X}}^{2}={\Big (}{\frac {\sigma _{Z}^{2}}{\sigma _{X}^{2}+\sigma _{Z}^{2}/N}}{\Big )}{\frac {\sigma _{X}^{2}}{N}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c2b6ff2c348535dd5596d53208144a0457040a01)
For very large
, we see that the MMSE estimator of a scalar with uniform aprior distribution can be approximated by the arithmetic average of all the observed data
![{\displaystyle {\hat {x}}={\frac {1}{N}}\sum _{i=1}^{N}y_{i},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/258eef9d970ffb493d16492f25c96a47366fa80a)
while the variance will be unaffected by data
and the LMMSE of the estimate will tend to zero.
However, the estimator is suboptimal since it is constrained to be linear. Had the random variable
also been Gaussian, then the estimator would have been optimal. Notice, that the form of the estimator will remain unchanged, regardless of the apriori distribution of
, so long as the mean and variance of these distributions are the same.
Example 3
Consider a variation of the above example: Two candidates are standing for an election. Let the fraction of votes that a candidate will receive on an election day be
Thus the fraction of votes the other candidate will receive will be
We shall take
as a random variable with a uniform prior distribution over
so that its mean is
and variance is
A few weeks before the election, two independent public opinion polls were conducted by two different pollsters. The first poll revealed that the candidate is likely to get
fraction of votes. Since some error is always present due to finite sampling and the particular polling methodology adopted, the first pollster declares their estimate to have an error
with zero mean and variance
Similarly, the second pollster declares their estimate to be
with an error
with zero mean and variance
Note that except for the mean and variance of the error, the error distribution is unspecified. How should the two polls be combined to obtain the voting prediction for the given candidate?
As with previous example, we have
![{\displaystyle {\begin{aligned}y_{1}&=x+z_{1}\\y_{2}&=x+z_{2}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f9baacb5520b201e0a10d9ad90721077d11add21)
Here, both the
. Thus, we can obtain the LMMSE estimate as the linear combination of
and
as
![{\displaystyle {\hat {x}}=w_{1}(y_{1}-{\bar {x}})+w_{2}(y_{2}-{\bar {x}})+{\bar {x}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b2449397a74f06291187d43cc9d94c2ca098ad30)
where the weights are given by
![{\displaystyle {\begin{aligned}w_{1}&={\frac {1/\sigma _{Z_{1}}^{2}}{1/\sigma _{Z_{1}}^{2}+1/\sigma _{Z_{2}}^{2}+1/\sigma _{X}^{2}}},\\w_{2}&={\frac {1/\sigma _{Z_{2}}^{2}}{1/\sigma _{Z_{1}}^{2}+1/\sigma _{Z_{2}}^{2}+1/\sigma _{X}^{2}}}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d921ea1b6ad902e31f13ba19c6aec6f65ef0add7)
Here, since the denominator term is constant, the poll with lower error is given higher weight in order to predict the election outcome. Lastly, the variance of
is given by
![{\displaystyle \sigma _{\hat {X}}^{2}={\frac {1/\sigma _{Z_{1}}^{2}+1/\sigma _{Z_{2}}^{2}}{1/\sigma _{Z_{1}}^{2}+1/\sigma _{Z_{2}}^{2}+1/\sigma _{X}^{2}}}\sigma _{X}^{2},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2d344b5af7133c0a7196e7f4d679427a8b7a7a9a)
which makes
smaller than
Thus, the LMMSE is given by
![{\displaystyle \mathrm {LMMSE} =\sigma _{X}^{2}-\sigma _{\hat {X}}^{2}={\frac {1}{1/\sigma _{Z_{1}}^{2}+1/\sigma _{Z_{2}}^{2}+1/\sigma _{X}^{2}}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/370abaa416b34940ffd3121ea88787d5a2004da5)
In general, if we have
pollsters, then
where the weight for i-th pollster is given by
and the LMMSE is given by
Example 4
Suppose that a musician is playing an instrument and that the sound is received by two microphones, each of them located at two different places. Let the attenuation of sound due to distance at each microphone be
and
, which are assumed to be known constants. Similarly, let the noise at each microphone be
and
, each with zero mean and variances
and
respectively. Let
denote the sound produced by the musician, which is a random variable with zero mean and variance
How should the recorded music from these two microphones be combined, after being synced with each other?
We can model the sound received by each microphone as
![{\displaystyle {\begin{aligned}y_{1}&=a_{1}x+z_{1}\\y_{2}&=a_{2}x+z_{2}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e76b54e394cafd950a94cde8691d0b51d9796b9d)
Here both the
. Thus, we can combine the two sounds as
![{\displaystyle y=w_{1}y_{1}+w_{2}y_{2}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9aa1c2ddeac6603f5fb7da84b3838e41c2d2db51)
where the i-th weight is given as
![{\displaystyle w_{i}={\frac {a_{i}/\sigma _{Z_{i}}^{2}}{\sum _{j}a_{j}^{2}/\sigma _{Z_{j}}^{2}+1/\sigma _{X}^{2}}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6495f54da4510f2d36abe277f991d28b6fe0243d)
See also
Notes
- ^ "Mean Squared Error (MSE)". www.probabilitycourse.com. Retrieved 9 May 2017.
- ^ Moon and Stirling.
Further reading
- Johnson, D. "Minimum Mean Squared Error Estimators". Connexions. Archived from Minimum Mean Squared Error Estimators the original on 25 July 2008. Retrieved 8 January 2013.
{{cite web}}
: Check |url=
value (help) - Jaynes, E.T. (2003). Probability Theory: The Logic of Science. Cambridge University Press. ISBN 978-0521592710.
- Bibby, J.; Toutenburg, H. (1977). Prediction and Improved Estimation in Linear Models. Wiley. ISBN 9780471016564.
- Lehmann, E. L.; Casella, G. (1998). "Chapter 4". Theory of Point Estimation (2nd ed.). Springer. ISBN 0-387-98502-6.
- Kay, S. M. (1993). Fundamentals of Statistical Signal Processing: Estimation Theory. Prentice Hall. pp. 344–350. ISBN 0-13-042268-1.
- Luenberger, D.G. (1969). "Chapter 4, Least-squares estimation". Optimization by Vector Space Methods (1st ed.). Wiley. ISBN 978-0471181170.
- Moon, T.K.; Stirling, W.C. (2000). Mathematical Methods and Algorithms for Signal Processing (1st ed.). Prentice Hall. ISBN 978-0201361865.
- Van Trees, H. L. (1968). Detection, Estimation, and Modulation Theory, Part I. New York: Wiley. ISBN 0-471-09517-6.
- Haykin, S.O. (2013). Adaptive Filter Theory (5th ed.). Prentice Hall. ISBN 978-0132671453.