我刚刚发现了这个fitdistrplus软件包,我把它和Poisson发行版一起运行等等.但是在尝试使用二项式时我遇到了问题:
set.seed(20)
#Binomial distributed, mean score of 2
scorebinom <- rbinom(n=40,size=8,prob=.25)
fitBinom=fitdist(data=scorebinom, dist="binom", start=list(size=8, prob=mean(scorebinom)/8))
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Error in fitdist(data = scorebinom, dist = "binom", start = list(size = 8, :
the function mle failed to estimate the parameters,
with the error code 100
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Run Code Online (Sandbox Code Playgroud)
我从这个包中看到了很多关于负二项分布的文档,但关于二项式并不多.这个功能确实出现了支持这种分布(虽然fitdistr在MASS没有).
有什么想法吗?
小智 6
你不会总是知道试验次数(即尺寸参数)吗?如果是这样,那就试试吧
fitBinom=fitdist(data=scorebinom, dist="binom", fix.arg=list(size=8), start=list(prob=0.3))
Run Code Online (Sandbox Code Playgroud)
估计p及其误差.
| 归档时间: |
|
| 查看次数: |
5836 次 |
| 最近记录: |