[問題] 統軟問題

看板Statistics作者 (PUSH!)時間19年前 (2006/11/02 01:14), 編輯推噓2(200)
留言2則, 1人參與, 最新討論串1/1
pois<- function(n,rep) { i<- 1 z<- vector(mode="numeric",length=rep) y<- vector(mode="numeric",length=rep) while(i <=rep) {lambda<-20 u<-rpois(n,lambda) mu<-mean(u) z[i]<-sqrt(n/lambda)*(mu-lambda) i<-i+1 } x<-seq(-3,3,length=rep) plot(x,pnorm(x),type="l",xlab="x",ylab="Probability",col=4,lty=1) for (j in (1:rep)) { y[j]<-sum(z<=x[j])/rep } lines(x,y,lty=2,col=2) ch<-c("Normal CDF","Approx. CDF") legend(-3,0.9,ch,col=c(4,2),lty=1:2) print(shapiro.test(z)) } 請問一下分配要改成bonomial要怎麼改呢? 改了好幾次圖都不是正確的!! 有大大可以幫我解決嗎? -- http://www.wretch.cc/album/xung86 我要廣末住我家 因為妳就是她 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.171.53.152

11/02 02:31, , 1F
學弟,抓到你了,作業要自己作喔~~~
11/02 02:31, 1F

11/02 02:37, , 2F
來去跟歷史老師告狀XD
11/02 02:37, 2F
文章代碼(AID): #15IDNa4H (Statistics)