In[]:=
CompoundExpression[
]
​​deploy
Fri 12 Jul 2024 16:50:53
​- 1/n decay of singular values (open question): math.SE post​- square root decay of eigenvalues: math.SE post​- norm of
matrix
dlog2
math.SE post​​
In[]:=
SF=StringForm;​​​​getPowerLaw[yvals_]:=Module[{logData,linearFit,a,b,x,xvals},​​xvals=Range@Length@yvals;​​logData=Transpose[{Log[xvals],Log[yvals]}];​​linearFit=LinearModelFit[logData,x,x];​​{a,b}=linearFit["BestFitParameters"];​​fit=Exp[a+b*Log[x]];​​fitModel=Function@@{{x},fit};​​fitModel[t]​​];​​​​​​rowNormalize[dataset_]:=Normalize/@dataset;​​makeTriangularDataset[d_]:=rowNormalize@LowerTriangularize[ConstantArray[1.,{d,d}]];​​​​makeRepeatedDataset[d_]:=IdentityMatrix[d]~Join~IdentityMatrix[d];​​​​(*Symmetricsquareroot*)​​symsqrt[m_]:=Module[{U,S,W},​​{U,S,W}=SingularValueDecomposition[m];​​U.Sqrt[S].Transpose[W]​​];​​​​subsample[ll_]:=ll[[;;Min[10,Length@ll],All]];​​​​CircleTimes=KroneckerProduct;

Power law fits

Singular values

In[]:=
powerLawFit[xvals_,yvals_]:=Module[{logData,linearFit,a,b,x},logData=Transpose[{Log[xvals],Log[yvals]}];​​linearFit=LinearModelFit[logData,x,x];​​{a,b}=linearFit["BestFitParameters"];​​fit=Exp[a+b*Log[x]];​​fitModel=Function@@{{x},fit};​​fitModel​​];​​​​rowNormalize[dataset_]:=Normalize/@dataset;​​svals[d_]:=With[{dataset=rowNormalize@N@UpperTriangularize[ConstantArray[1.,{d,d}]]},​​SingularValueList[dataset]​​];​​​​d=800;​​data={Range[d],svals[d]};​​sf={"Log","Log"};​​sf={Automatic,Automatic};​​​​observedPlot=ListPlot[subsample@data,ScalingFunctions->sf];​​​​​​{xvals,yvals}=data;​​f=powerLawFit[xvals,yvals]​​fittedPlot=Plot[{None,None,f[t]},{t,0,Length[xvals]},PlotLegends->{None,None,f[t]},ScalingFunctions->sf];​​Show[fittedPlot,observedPlot,ImageSize->Large,AxesLabel->{"k","value"},PlotLabel->SF["Singular values for d=``",d]]​​
Out[]=
Function{x$33105},
21.8692
1.0422
x$33105

Out[]=
21.8692
1.0422
t

Norm as a function of d, Vincent’s plot

In[]:=
norm[d_]:=With[{dataset=rowNormalize@N@UpperTriangularize[ConstantArray[1.,{d,d}]]},​​Norm[dataset]];​​sf={"Log","Log"};​​(*data=Table[{d,norm[d]},{d,10,1000,10}];*)​​dimsList=Table[
k
2
,{k,4,12}];​​data=Table[{dd,norm[dd]},{dd,dimsList}];​​observedPlot=ListPlot[subsample@data,ScalingFunctions->sf,PlotLegends->{"empirical"}];​​​​{xvals,yvals}=data;​​f=powerLawFit[xvals,yvals];​​fittedPlot=Plot[{None,None,f[t]},{t,0,Max[xvals]},PlotLegends->{None,None,f[t]},ScalingFunctions->sf];​​vincentPlot=Plot
dLog[2]
,{d,Min[dimsList],Max[dimsList]},ScalingFunctions->sf,PlotStyle->{Red,Thick,Dotted},PlotLegends->SF"vincent
dLog[2]
";​​Show[observedPlot,fittedPlot,vincentPlot,PlotLabel->SF["Norm of triangular matrix",d],ImageSize->Large,AxesLabel->{"d","norm"}]​​​​
Out[]=
empirical
0.844826
0.497782
t
vincent
dLog[2]

Effective Ranks

In[]:=
d=4000;​​svals=SingularValueList@rowNormalize@N@UpperTriangularize[ConstantArray[1.,{d,d}]];​​TableForm​​{"norm",Max[svals]},​​"R",
2
Total[svals]
Total[
2
svals
]
,​​"r",
Total[svals]
Max[svals]
​​​​​​​​svals2=svals/Total[svals];DiscretePlot[Total[
k
svals2
],{k,1,100},ScalingFunctions->{Automatic,"Log"},PlotRange->All,PlotLabel->"Singular value moments",AxesLabel->{"k","moment"}]​​

Eigenvalues and singular values

TLDR:
Eigenvalues fall off exactly as 1/sqrt(d), singular values approximately as 1/d
Right svecs are 0 for the last coordinate
Left svecs are 1 for the last coordinate
Stationary distribution is mostly last coordinate

Comparing density to others

Eigenvalues of GD operator

Choi vs eigenvalues

Do the I-T