lundi 29 mars 2021

Random matrices in R eigenvalue plot

enter image description hereThe picture above is from the book Spectra and Pseudospectra of Trefethen and Embree.It illustrates the eigenvalues of N random matrices: They are uniformly distributed in the unit disk. As they state: "Of course, for each finite N this statement cannot be ex­ actly correct. For complex matrices, the probability density function of the eigenvalues is a continuous function that is nonzero throughout the com­ plex plane. For real matrices, not only is the probability density nonzero throughout the plane, but it has a delta function singularity along the real axis, since for any finite N, there is a positive probability that some eigenvalues will be purely reaP In the limit as N goes to infinity, however, these complexities fade away and the distribution converges to the constant $pi^(-1)$ inside the unit disk and zero outside."

my effort in R is this :


n=20
x = matrix(c(rnorm(n*n)),n,n)
plot((eigen(x)$values)/sqrt(n))
plotrix::draw.circle(0, 0, 1, nv = 1000, border = NULL, col = NA, lty = 1, lwd = 1)
norm(x,"2")

But the results are not right.What I am doing wrong? The norm is not 2. And I am not happy with the unit disk plot. Any help?




Aucun commentaire:

Enregistrer un commentaire