An observation on measurements on A reconstructed from its SVD factorization
by Nasser M. Abbasi, May 20,2007

Starting with a random A matrix, its SVD is found using varying number of its largest singular values k.  

Each time, a measure on A is compared with the same measure made on a version of A that was obtained by reconstructing A from its SVD. 

For example, A is reconstructed using the first of its singular values, next, using the first 2 of its singular values, next, using the first 3 of its singular values, and so forth until all the singular values are used (the number of the singular value is the rank of A). 

Each time the original A matrix is compared with the reconstructed A to obtain a measure of information content in A as a function of k (the number of the singular values used).

Measures used to compare the original matrix A with the reconstructed A are norm1,norm2,norm infinity,norm Frobenius,max element, and the mean value of A.

This shows that the more singular values used to reconstruct A, the better the approximation will be using any of the measure.  However, Using the 2-norm for a measure of A, shows that using any number of singular values will produce as good a reconstruction as the other. So, deciding on which measure to use is important.

Generate a random real matrix 30 by 20

m=30;
n=20;
A=Table[Table[RandomReal[{0,100.}],{n}],{m}];
MatrixPlot[A]

ListPlot3D[A,Mesh->None,InterpolationOrder->0,ColorFunction->"SouthwestColors",Filling->Axis]

Determine SVD for matrix A associated with k largest singular values of A. Change k from 1 up to the rank. For Each k, find the norm of the reconstructed A matrix, and compare this norm with the original norm of A. Plot the difference in the norms

NORM1=2; NORM2=3; NORMinf=4; NORMFrob=5; MAXELE=6; MEANELE=7;
r=MatrixRank[A];
norm1=Norm[A,1];
norm2=Norm[A,2];
norminf=Norm[A,Infinity];
normfrob=Norm[A,"Frobenius"];
maxA=Abs[Max[A]];
meanA=Abs[Mean[Mean[A]]];

data=Table[0,{r},{7}];

For[i=1,i≤ r,i++,{
{u,d,Vt}=SingularValueDecomposition[A,i];
Aback=u.d.Transpose[Vt];
data[[i,1]]=i; 
data[[i,NORM1]]=Norm[Aback,1]; 
data[[i,NORM2]]=Norm[Aback,2]; 
data[[i,NORMinf]]=Norm[Aback,Infinity]; 
data[[i,NORMFrob]]=Norm[Aback,"Frobenius"]; 
data[[i,MAXELE]]=Abs[Max[Aback]]; 
data[[i,MEANELE]]=Abs[Mean[Mean[Aback]]]; 
}
];

Now plot the differences between the largest elements in A and the reconstructed A

Grid[{

{ListLinePlot[data[[All,NORM1]]-norm1,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] Norm 1",AxesLabel->{"k",None},ImageSize->250,ImagePadding->30],
ListLinePlot[data[[All,NORM2]]-norm2,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] 2 Norm",ImageSize->250,ImagePadding->{{60,10},{30,20}}],
ListLinePlot[data[[All,NORMFrob]]-normfrob,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] Frobenius Norm",ImageSize->250,ImagePadding->30]}
,
{ListLinePlot[data[[All,NORMinf]]-norminf,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] Norm ∞",ImageSize->250,ImagePadding->30],
ListLinePlot[data[[All,MAXELE]]-maxA,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] Max",ImageSize->250,ImagePadding->30],
ListLinePlot[data[[All,MEANELE]]-meanA,PlotRange->All,AxesOrigin->{0,0},PlotLabel->"\[LeftDoubleBracketingBar]A\[RightDoubleBracketingBar] Mean",ImageSize->250,ImagePadding->30]
}
},Frame->All
]