【问题标题】:How to select the distribution parameter through fitdistrplus package?如何通过 fitdistrplus 包选择分布参数?
【发布时间】:2020-09-08 16:58:56
【问题描述】:
library(fitdistrplus)
data(groundbeef)
serving <- groundbeef$serving
fitg <- fitdist(serving, "gamma")
res<-bootdist(fitg)#further accuracy estimate
#which parameter should be selected?
> summary(res)
Parametric bootstrap medians and 95% percentile CI 
Median       2.5%      97.5%
shape 4.04523398 3.41773958 4.80480936
rate  0.05495878 0.04632007 0.06587446
> res$fitpart$estimate
shape       rate 
4.00825257 0.05441911

bootdist() 总是用于在fitdis() 之后获得更准确的参数。

如上例,summary(res)提供多个参数,res$fitpart$estimate提供一个参数,应该选择哪一个?

【问题讨论】:

    标签: r statistics fitdistrplus


    【解决方案1】:

    当您进行引导时,您会通过替换对数据进行采样,并重新估计参数。在这种情况下,您将分布拟合到从原始数据集中采样的数据集。

    通过这 N 个估计值,您可以获得中位数和置信区间。

    如果你想要最适合你的数据的参数,你需要从fitdist(serving, "gamma")获取它

    【讨论】:

      【解决方案2】:

      来自help(bootdist)

      使用参数或非参数自举重采样来模拟拟合到非删失数据的分布参数的不确定性。

      因此,bootdist 的目的不是确定参数,而是估计参数拟合的不确定性。

      因此,一般来说,您应该使用:

      fitg$estimate
           shape       rate 
      4.00825257 0.05441911 
      

      【讨论】:

      • 感谢您的回答。我误解了bootdist。起初我猜97.5% 是最准确的参数。
      猜你喜欢
      • 2016-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-10
      相关资源
      最近更新 更多