SLIDE 10 Least squares method and the SVD
matlab demo
The SVD of A is in agreement with the original decomposition, whereas the SVD of AtA truncates the dynamical range of the spectrum relative to σ2
1
>> [U1 ,S1 ,V1] = svd(A); U1 , V1 , diag(S1)' U1 =
- 7.071067811865475e-01
- 7.071067811865476e-01
- 7.071067811865476e-01
7.071067811865475 e-01 1.000000000000000 e+00 V1 =
- 5.773502691896258e-01
- 5.773502315590063e-01
- 5.773503068202428e-01
7.071067811865475 e-01 4.608790676874364 e-08
- 7.071067811865464e-01
- 4.082482904638632e-01
8.164966075365897 e-01
ans = 9.999999999999999 e-01 9.999999462588933 e-10 >> [U2 ,S2 ,V2] = svd(A'*A); U2 , V2 , diag(S2)' U2 =
- 5.773502691896260e-01
- 7.993060164940310e-01
1.666630092825368 e-01 7.071067811865475 e-01
5.915328051214906 e-01
4.593701683080254 e-01 7.888677847408841 e-01 V2 =
7.242703261997147 e-01 3.769604239880175 e-01 7.071067811865475 e-01 6.743633567555686 e-01
- 2.126830107586453e-01
- 4.082482904638631e-01
1.437586785273193 e-01
ans = 1.000000000000000 e+00 5.019856335253205 e-17 1.772060549260711 e-17 Lecture 2: Least Squares 10 / 47