In[]:=
CompoundExpression[
]
​​deploy
Sun 16 Jul 2023 18:59:31

Distribution of singular values

Related notebooks:
- Grouping distributions by asymptotics: notebook
In[]:=
Clear["Global`*"];​​genCDF[coefs_]:=(​​z=Total[coefs];​​xvals=Sort@coefs;​​yvals=Range@Length@coefs/Length[coefs];​​{xvals,yvals}​​);​​​​n=1000;​​dists={​​{"Normal",NormalDistribution[]},​​{"Cauchy",CauchyDistribution[]},​​{"Uniform",UniformDistribution[]},​​{"
2
Chi
",ChiSquareDistribution[1]},​​{"Rayleigh",RayleighDistribution[1]},​​{"Lognormal",LogNormalDistribution[0,1]},​​{"Inverse Gamma",InverseGammaDistribution[1,2]}​​};​​​​SeedRandom[Method->"MKL"];​​​​valLists=SingularValueListRandomVariate[Last@#,{n,n}]
n
&/@dists;​​sf={"Log","Log"};​​SF=StringForm;​​minmax=Quantile[Flatten@valLists,#]&/@{.01,.9};​​legends=SF["x=``",First@#]&/@dists;​​refPlot=Plot[Min[x,1],{x,Sequence@@minmax},ScalingFunctions->sf,PlotStyle->{Thick,Black},PlotLegends->{"min(x,1)"}];​​svalPlot=ListPlot@@{genCDF[#]&/@valLists,ScalingFunctions->sf,PlotLegends->legends};​​Show[refPlot,svalPlot,PlotLabel->SF["CDF of σ(A), A=``x`` with entries  IID x",n,n],AxesLabel->{"σ"},ImageSize->Large]​​
Out[]=
min(x,1)
x=Normal
x=Cauchy
x=Uniform
x=
2
Chi
x=Rayleigh
x=Lognormal
x=Inverse Gamma
In[]:=
n=1000;​​valLists=Abs@EigenvaluesRandomVariate[Last@#,{n,n}]
n
&/@dists;​​sf={"Log","Log"};​​SF=StringForm;​​minmax=Quantile[Flatten@valLists,#]&/@{.01,.9};​​legends=SF["x=``",First@#]&/@dists;​​refPlot=Plot[Min[
2
x
,1],{x,Sequence@@minmax},ScalingFunctions->sf,PlotStyle->{Thick,Black},PlotLegends->{"min(​
2
x
​,1)"}];​​svalPlot=ListPlot@@{genCDF[#]&/@valLists,ScalingFunctions->sf,PlotLegends->legends};​​Show[refPlot,svalPlot,PlotLabel->SF["CDF of |λ(A)|, A=``x`` with entries  IID x",n,n],AxesLabel->{"|λ|"},ImageSize->Large]​​
Out[]=
min(​
2
x
​,1)
x=Normal
x=Cauchy
x=Uniform
x=
2
Chi
x=Rayleigh
x=Lognormal
x=Inverse Gamma
In[]:=
valLists=Abs@Re@EigenvaluesRandomVariate[Last@#,{n,n}]
n
&/@dists;​​sf={"Log","Log"};​​SF=StringForm;​​minmax=Quantile[Flatten@valLists,#]&/@{.01,.9};​​legends=SF["x=``",First@#]&/@dists;​​ref=CDF[WignerSemicircleDistribution[1],x];​​refPlot=Plot[Min[x,1],{x,Sequence@@minmax},ScalingFunctions->sf,PlotStyle->{Thick,Black},PlotLegends->{"min(x,1)"}];​​svalPlot=ListPlot@@{genCDF[#]&/@valLists,ScalingFunctions->sf,PlotLegends->legends};​​Show[refPlot,svalPlot,PlotLabel->SF["CDF of Re[λ(A)], A=``x`` with entries  IID x",n,n],AxesLabel->{"Re[λ]"},ImageSize->Large]​​
Out[]=
min(x,1)
x=Normal
x=Cauchy
x=Uniform
x=
2
Chi
x=Rayleigh
x=Lognormal
x=Inverse Gamma

Normalized rows

In[]:=
Clear["Global`*"];​​normRows[mat_]:=Normalize/@mat;​​normEigs[eigs_]:=eigs/Max[eigs];​​genCDF[coefs_]:=(​​xvals=Sort@coefs;​​yvals=Range@Length@coefs/Length[coefs];​​{xvals,yvals}​​);​​​​n=1000;​​dists={​​{"Normal",NormalDistribution[]},​​{"Cauchy",CauchyDistribution[]},​​{"Uniform",UniformDistribution[]},​​{"Beta(1,1/2)",BetaDistribution[1,1/2]},​​{"
2
Chi
",ChiSquareDistribution[1]},​​{"Rayleigh",RayleighDistribution[1]},​​{"Lognormal",LogNormalDistribution[0,1]},​​{"Inverse Gamma",InverseGammaDistribution[1,2]}​​};​​​​SeedRandom[Method->"MKL"];​​​​valLists=SingularValueListnormEigs@normRows@RandomVariate[Last@#,{n,n}]
n
&/@dists;​​sf={"Log","Log"};​​SF=StringForm;​​minmax=Quantile[Flatten@valLists,#]&/@{.01,.9};​​legends=SF["x=``",First@#]&/@dists;​​refPlot=Plot[Min[x,1],{x,Sequence@@minmax},ScalingFunctions->sf,PlotStyle->{Thick,Black},PlotLegends->{"min(x,1)"}];​​svalPlot=ListLinePlot@@{genCDF[#]&/@valLists,ScalingFunctions->sf,PlotLegends->legends};​​Show[refPlot,svalPlot,PlotLabel->SF["CDF of σ(A), A=``x`` with entries  IID x",n,n],AxesLabel->{"σ"}]​​