If is known, how do you derive the Sherman–Morrison formula for ? How do you verify it for and , and why does it matter for online ridge regression?
Linear algebra and optimisation, Matrix inverses
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can derive and apply the rank-one inverse update, and see that it cuts the cost from to .
Key idea
, valid when .
Steps
- Guess that the inverse has the form for a scalar , because a rank-one change should give a rank-one correction.
- Multiply by : .
- Collect the terms: . This is zero when , which gives the formula.
- Verify numerically. and , so and the denominator is .
- The correction is . So .
- Check: has determinant , whose inverse is . This matches. The determinant lemma gives the same check: .
- Use: in online ridge regression, and each new example adds . The formula updates in instead of re-inverting in . This is the idea behind recursive least squares.
Common mistakes
- Dropping the in the denominator, or using alone. The check then fails.
- Writing as , which has the wrong shape. is a matrix and is a scalar.
- Using it for a rank- update. That needs the Woodbury identity, with a inverse in place of the scalar.
How long your answer should be
One page; 6 minutes.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: For the underdetermined system with and , how do you find the solution with the smallest norm, and why is the answer ?
Next in Linear algebra and optimisation: Derive why the direction of fastest local decrease of at is , using a first-order Taylor expansion and the Cauchy–Schwarz inequality. For at , compare the rate of decrease along with the one along ?