Exercise · ZW-LINEAR-LEAST-SQUARES-001 · ★☆☆ Basic
What is the gradient of \(f(x)=\|Ax-b\|_2^2\) with respect to \(x\)?
Choose one option.
A \(A^\top(Ax-b)\) B \(2(Ax-b)\) C \(2A^\top(Ax-b)\) D \(2A(Ax-b)\)
Show answer
← Back to the question
Explanation The gradient of the squared norm is \(2A^\top(Ax-b)\), with the transpose of \(A\) multiplying the residual. The option using \(A\) without transposing is dimensionally incompatible when \(A\) is not square.
Optimization problem that minimizes the sum of squared residuals \(\|Ax-b\|_2^2\) to approximate a vector \(b\) by linear combinations of the columns of \(A\).
\[\min_{x}\ \|Ax-b\|_2^2 \quad \Rightarrow \quad A^\top A\,x = A^\top b\]
More practice problems: linear least squares ZW-LINEAR-LEAST-SQUARES-002 What are the normal equations of the least squares problem?ZW-LINEAR-LEAST-SQUARES-003 If A has linearly independent columns, how many solutions does the least squares problem have?ZW-LINEAR-LEAST-SQUARES-004 What does Ax^* represent geometrically, where x^* is the least squares solution?ZW-LINEAR-LEAST-SQUARES-005 If A is a 3× 2 matrix, what is the dimension of A^top A?ZW-LINEAR-LEAST-SQUARES-006 Given A=[1 0; 0 1; 1 1] and b=(1,2,4)^top, what is A^top b?ZW-LINEAR-LEAST-SQUARES-007 With A^top A=[2 1; 1 2] and A^top b=(3,3)^top, what is the least squares solution?ZW-LINEAR-LEAST-SQUARES-008 To fit y=c t (no intercept) to the points (1,2) and (2,3), what is c?ZW-LINEAR-LEAST-SQUARES-009 Why is it not advisable to compute the least squares solution as x=(A^top A)^-1A^top b when A^top A…