x1<-c(-0.148,-0.604,-1.347,0.521,-1.092,0.060,0.138,-1.514,2.803,1.864) x2<-c(-0.947,-0.595,-0.089,-0.326,-0.349,1.813,-0.849,0.574,1.129,-1.067) mx1<-mean(x1) mx2<-mean(x2) > mx1 [1] 0.0681 > mex2 [1] -0.0706 xw<-matrix(c(x1-mx1,x2-mx2),10,2) # calculation of Wishart matrix w<-t(xw)%*%xw # MLE w/10 [,1] [,2] [1,] 1.7264803 0.1177041 [2,] 0.1177041 0.8187364 # correlation rho<-w[1,2]/(sqrt(w[1,1]*w[2,2])) rho [1] 0.09900077 # eigenvalues eigen.w<-eigen(w) #eigen.w lam<-c(eigen.w$values) lam [1] 17.414942 8.037225 lam/10 [1] 1.7414942 0.8037225