std_sv
std_sv

Reputation: 25

Singular value decomposition approximation

I was asked in school to do a SVD on the matrix:

A = [1 3 1 2;
     0 2 1 4; 
     6 5 2 1]

and then: calculate an approximation of A called A_hat by setting the third singular value σ_3 to zero.

I have done the SVD, but I'm kind of clueless about the second part. Can somebody please help me?

Upvotes: 0

Views: 263

Answers (1)

Paul R
Paul R

Reputation: 212929

Assuming MATLAB (or Octave):

A = [1 3 1 2;
     0 2 1 4;
     6 5 2 1];
[U,S,V] = svd(A);
S(3,3) = 0;
A_hat = U*S*V';

This gives:

A_hat =

   1.37047   2.50649   1.03003   2.30320
  -0.20009   2.26654   0.98378   3.83625
   5.90727   5.12352   1.99248   0.92411

Upvotes: 2

Related Questions