1
我無法計算泊松分佈的最大似然估計量和BIC ..我能夠得到直方圖但不能在其上疊加核密度估計。擬合泊松分佈
你能告訴我我哪裏出錯了嗎?
x.pois<-rpois(Y1, 20)
hist(x.pois, breaks=100,freq=FALSE)
lines(density(Y1, bw=0.8), col="red")
library(MASS)
fitdistr(Y1,densfun="pois")
my.mle<-fitdistr(Y1, densfun="poison")
print(my.mle)
BIC(my.mle)
什麼是對象'Y1'? –
毒性代碼?推測你的意思是「泊松」而不是「毒藥」。 – James
請注意,它被認爲是更好的形式來[編輯你現有的問題](http://meta.stackexchange.com/questions/171803/new-question-or-edit-existing-question-with-new-sample-code? lq = 1),而不是[問一個新的,幾乎相同的](http://stackoverflow.com/questions/20984577/poisson-distribution-in-r)... –