In[]:=
Mon 17 Jul 2023 14:23:45
Spectrum of product of random matrices
Spectrum of product of random matrices
In[]:=
ClearAll["Global`*"];SeedRandom[1];spectralNormalize[evals_]:=evals/Max[evals];SF=StringForm;If[SUPERLARGE`SUPERLARGE===1,n=1000;numSamples=100;Clear[SUPERLARGE`SUPERLARGE];x0=;Print["Running large"],n=100;numSamples=10;x0=;];(*SingleGaussianmatrix*)sample:=RandomVariate[NormalDistribution[],{n,n}];(*Productofkrandommatrices*)randomProduct[k_]:=Nest[#.sample&,sample,k-1];(*CDFoflistofnumbers*)genCDF[coefs_]:={Sort@coefs,Range@Length@coefs/Length[coefs]};sf=None;sf={"Log","Log"};kvals=Range[5];legends=SF["k=``",#]&/@kvals;guesses=,,,;(*Productofkrandommatrices*)productEvals[k_]:=;(*Computeseveralproducts,pooltheirspectra*)batchedProductEvals[k_,samples_]:=Flatten@Table[productEvals[k],samples];observedPlot=ListLinePlot[Table[genCDF[batchedProductEvals[k,numSamples]],{k,kvals}],ScalingFunctions->sf,PlotLegends->legends];predictedPlot=Plot@@{guesses,{x,x0,1},ScalingFunctions->sf,PlotStyle->Dashed,PlotLegends->guesses};Show[observedPlot,predictedPlot,PlotLabel->SF["CDF of σ(FractionBox[\(A\), \(\(||\)\(A\)\(||\)\)] for A=product of k IID matrices",n,n],AxesLabel->{""}]
-20
10
-12
10
1/2
x
1/3
x
1/4
x
1/5
x
2
(spectralNormalize@SingularValueList[randomProduct@k])
2
)\),
2
σ
Running large
Out[]=
In[]:=
SUPERLARGE`SUPERLARGE=1
Out[]=
1