# This is the first Monte-Carlo # Convergence for Sample Covariance # Set the working directory with File > Working Directory # *************** Before the loop ********************* nulldata 5000 set seed 547 matrix S = {1,0.5;0.5,1} matrix A = cholesky(S) #****** open a loop, to be repeated R=500 times ********** loop 500 --progressive --quiet genr u1 = normal() genr u2 = normal() genr x1 = A[1,1]*u1+A[1,2]*u2 genr x2 = A[2,1]*u1+A[2,2]*u2 smpl 5 --random genr cov5 = cov(x1,x2) smpl full smpl 50 --random genr cov50 = cov(x1,x2) smpl full smpl 500 --random genr cov500 = cov(x1,x2) smpl full genr cov5000 = cov(x1,x2) store myfirstMC.gtd cov5 cov50 cov500 cov5000 endloop #*********** we open the results ************************ open myfirstMC.gtd summary cov* --simple