EE5180_linear_regression_tutorial
EE5180_linear_regression_tutorial
Practice Problems
Topics: Linear Regression
AT Ax = AT b
where A ∈ Rn×m , b ∈ Rn .Show that there always exists a solution for the system of
equations above.
4. Find the line of the wx + b that minimizes the squared error for the following 1-d
regression problem:
x y
1 1
2 2
4 3
5 4
6 4
(Hint: Consider least squares solution with the feature vector ϕ : R 7→ R2 given as
ϕ(x) = [x, 1].)
′
5. Let ϕ : Rd 7→ Rd be the feature mapping for performing k-degree polynomial regression
on a d-dimensional input. For example if k = 2, d = 2 then ϕ([x1 , x2 ]) = [1, x1 , x2 ,
x21 ,x22 , x1 x2 ]
• Give ϕ for k = 2, d = 3
• Give ϕ for k = 3, d = 2
1
6. Consider a data set in which each data point yn is associated with a weighting factor rn
> 0, so that the sum-of-squares error function becomes
N
1X
ED (w) = rn {yn − wT ϕ(xn )}2 (1)
2 n=1
Find an expression for the solution w∗ that minimizes this error function.