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()
always used to get more accurate parameter after fitdis()
.
As above example,summary(res)
provide several parameters,res$fitpart$estimate
provide one parameter,which one should be selected?
进行引导时,将对数据进行替换采样,然后重新估计参数。在这种情况下,您可以使分布适合从原始数据集采样的数据集。
使用这N个估计值,您可以获得中位数和置信区间。
If you want the parameter that best fits your data, you need to get it from
fitdist(serving, "gamma")
From
help(bootdist)
:Thus, the purpose of
bootdist
is not to determine the parameters, but rather estimate the uncertainty in the fit of the parameters.因此,通常应使用: