by Dr Mikkel Lykkegaard
Bayesian Linear Regression and parameter Estimation
5. Linear Least Squares Breakdown and Bayesian Linear Regression
- Identify ill-conditioned systems of equations.
- Use a ridge regressor to regularise the linear least squares solution.
- Find the Bayesian posterior distribution for a linear model with a Gaussian prior and likelihood.
Linear Least Squares Breakdown
A Motivating Example
Consider the system of equations
with
This is a minimal example from my favourite book on inverse problems, Hansen (2010). While this is a contrived example, it illustrates an very common issue with least squares estimates.
The least squares estimator for this equation is
Now that looks fine at first glance, but what if I told you that the right hand side was noisy?
Our vector of measurements had been perturbed by some noise , i.e. , with
This is not a huge amount of noise, but the least squares solution to is in fact ! We can modify the original equation a little to take the noise into account:
with , that is the signal includes additive white Gaussian noise.
In this example, I knew exactly how much noise was added, so I could recover the true coefficients, but in reality you will not know the exact measurement errors. If you did, they wouldn't be errors! In the best case scenario, you will know the approximate variance of the noise.
How did this precariuous situation come to be? Well, as it turns out, is what is commonly referred to as ill-conditioned, meaning that (certain) large pertubations in the input do not change the output much. And conversely, small pertubations in the measurements can lead to large pertubatons in the estimated coefficients.
Regularisation
A common approach to alleviate the above problem is ridge regression, also sometimes referred to as Tikhonov regularisation. The idea here is to add a shift to the diagonal of the moment matrix before inverting it, leading to the ridge estimator
where is the ridge parameter, which determines the "stength" of regularisation. For example, for , we get , which is much closer to the true parameters than the naĆÆve least squares estimator.
This is equivalent of solving the regularised least squares problem
That is all fine and well, but it leaves an open question of how to choose ? In practice, this is often done heuristically, and according to certain well established criteria, as one can study in much more detail in e.g. Hansen (2010). However, these methods still produce a single estimate, rather than a distribution of possible estimates. This is why we will now give this problem the Bayesian treatment.
A Bayesian Approach
To keep this section simple, we are going to make a few relatively strong assumptions. First, we will assume that the noise comes from a zero-mean Gaussian with known variance , . That allows is to write the likelihood as . Furthermore, we assume that the prior distribution of model parameters is also Gaussian, . That alows us to write the posterior distribution as (you guessed it!) a Gaussian:
with
Please refer to e.g. Bishop (2006) for more details. For example, if we for the problem outlined above choose , and , we get
References
Hansen, Per Christian. Discrete Inverse Problems: Insight and Algorithms. Fundamentals of Algorithms. Philadelphia: Society for Industrial and Applied Mathematics, 2010.
Bishop, Christopher M. Pattern Recognition and Machine Learning. Information Science and Statistics. New York: Springer, 2006.