Description
Last updated
Last updated
Let's try to understand how least squares works in one dimension.
In this example, we're trying to predict based off of . However, has components that are not in , making it impossible to estimate completely accurately. Our best estimate would be , i.e. the component of that is in . The error between and is denoted by , which is perpendicular to as that minimizes its norm and the error.
We know that must be a multiple of as it is in . This means that where is a constant. Let's try solving for . Since is orthogonal to , we know that their dot product is . Hence,
The general form for least squares is therefore
Note: Refer to the lecture notes to see the general derivation.
Rearranging this equation to solve for gives us .
This same concept can be applied to higher dimensions as well by simply replacing
by where
or .