r - 如何通过 fitdistrplus 包选择分布参数?
问题描述
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
提供一个参数,应该选择哪一个?
解决方案
当您进行引导时,您会通过替换对数据进行采样,并重新估计参数。在这种情况下,您将分布拟合到从原始数据集中采样的数据集。
通过这些 N 个估计,您可以获得中位数和置信区间。
如果您想要最适合您的数据的参数,您需要从fitdist(serving, "gamma")
推荐阅读
- spring - 使用配置为基于 UI 的路由的网关的简单 spring-boot 抛出 404
- docker - Visual Studio 2019 Docker - 手动创建的 .net core 3.1 容器未在浏览器中打开
- terraform - terraform 无法重命名多个 aws 资源
- python - 无论如何限制模块中的方法在python中导入?
- typescript - 如何使用 agSelectCellEditor 获取来自 Angular Grid 中数据库的下拉值
- r - 如何使用 for 循环在 R 中基于两个现有数据框创建数据框列表?
- http-live-streaming - Google Nest Hub 无法播放 hls
- javascript - 返回包含过滤嵌套数组的新对象
- python - python按位运算的奇怪结果
- tensorflow - 在 Tensorflow 中训练模型时如何使用半正弦函数作为损失函数?