如何拟合和检查负二项式分布以计算R中的数据?

时间:2018-10-09 15:04:13

标签: r histogram distribution normal-distribution binomial-coefficients

我有一个这样分发的样本,例如rnorm(300, mean=100, sd=10)(该rmrm仅用作样本数据)。我想使用ggplot2或基本R包在视觉上拟合负二项式(a) (b)还要进行适当的测试,以检查它是否实际上是负二项式(在这种情况下不应该)。我不确定如何在R中实现这一目标。

因此,我尝试将此作为初始起点(从thread开始)

tt <- c(1:100)    
hist(tt, prob = TRUE)
library(fitdistrplus)
fit <- fitdist(data = tt, distr = "nbinom", method = "mle")
fitD <- dnbinom(0:100, size=2.116252, mu=50.492772)
lines(fitD, lwd="3", col="blue")

但是,这使数据适合概率密度函数。我想使其符合规则的频率分布

0 个答案:

没有答案