[問題] R軟體的矩陣問題!

看板Statistics作者 (秘密客)時間13年前 (2012/09/18 07:05), 編輯推噓0(008)
留言8則, 2人參與, 最新討論串1/1
如果是跟統計軟體有關請重發文章 如果跟論文有關也煩請您重發文章 文章類別是為了幫助大家搜尋資料與解答,造成不便之處請見諒 Simulate 2,000 independent sets of i.i.d. standard Normal random numbers, with 50 observations in each set. Find the maximum absolute correlation coefficient among all pairs of sets. Comment on the results. What do you expect to see if there are 20,000 such independent sets? 有人可以幫忙解答一下嗎? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 204.52.215.1

09/18 10:06, , 1F
作業?
09/18 10:06, 1F

09/18 13:36, , 2F
DATA<-matrix(NA,50,2000);
09/18 13:36, 2F

09/18 13:36, , 3F
for(g in 1:2000){DATA[,g]<-rnorm(50)}
09/18 13:36, 3F

09/18 13:36, , 4F
x<-cor(DATA);x[abs(x)==1]<-0;
09/18 13:36, 4F

09/18 13:36, , 5F
y<-abs(x)==max(x) ;
09/18 13:36, 5F

09/18 13:37, , 6F
which(colSums(y)>0) ; which(rowSums(y)>0);
09/18 13:37, 6F

09/18 13:38, , 7F
Assume 只有一個最大值 & 最大值不可能為 1
09/18 13:38, 7F

09/18 13:38, , 8F
其它還有些手工的部分就自己學吧
09/18 13:38, 8F
文章代碼(AID): #1GLwpCf3 (Statistics)