Learn R Programming

fitdistrplus (version 1.0-2)

bootdist: Bootstrap simulation of uncertainty for non-censored data

Description

Uses parametric or nonparametric bootstrap resampling in order to simulate uncertainty in the parameters of the distribution fitted to non-censored data.

Usage

bootdist(f, bootmethod="param", niter=1001)
## S3 method for class 'bootdist':
print(x, \dots)
## S3 method for class 'bootdist':
plot(x, \dots)
## S3 method for class 'bootdist':
summary(object, \dots)

Arguments

f
An object of class "fitdist", output of the fitdist function.
bootmethod
A character string coding for the type of resampling : "param" for a parametric resampling and "nonparam" for a nonparametric resampling of data.
niter
The number of samples drawn by bootstrap.
x
An object of class "bootdist".
object
An object of class "bootdist".
...
Further arguments to be passed to generic methods

Value

  • bootdist returns an object of class "bootdist", a list with 6 components,
  • estima data frame containing the bootstrapped values of parameters.
  • converga vector containing the codes for convergence obtained if an iterative method is used to estimate parameters on each bootstraped data set (and 0 if a closed formula is used).
  • methodA character string coding for the type of resampling : "param" for a parametric resampling and "nonparam" for a nonparametric resampling.
  • nbbootThe number of samples drawn by bootstrap.
  • CIbootstrap medians and 95 percent confidence percentile intervals of parameters.
  • fitpartThe object of class "fitdist" on which the bootstrap procedure was applied.
  • Generic functions: [object Object],[object Object],[object Object]

Details

Samples are drawn by parametric bootstrap (resampling from the distribution fitted by fitdist) or nonparametric bootstrap (resampling with replacement from the data set). On each bootstrap sample the function mledist (or mmedist, qmedist, mgedist according to the component f$method of the object of class "fitdist") is used to estimate bootstrapped values of parameters. When that function fails to converge, NA values are returned. Medians and 2.5 and 97.5 percentiles are computed by removing NA values. The medians and the 95 percent confidence intervals of parameters (2.5 and 97.5 percentiles) are printed in the summary. If inferior to the whole number of iterations, the number of iterations for which the function converges is also printed in the summary. The plot of an object of class "bootdist" consists in a scatterplot or a matrix of scatterplots of the bootstrapped values of parameters. It uses the function stripchart when the fitted distribution is characterized by only one parameter, and the function plot in other cases. In these last cases, it provides a representation of the joint uncertainty distribution of the fitted parameters.

References

Cullen AC and Frey HC (1999) Probabilistic techniques in exposure assessment. Plenum Press, USA, pp. 181-241.

See Also

fitdist, mledist, qmedist, mmedist, mgedist and quantile.bootdist for another generic function to calculate quantiles from the fitted distribution and its bootstrap results.

Examples

Run this code
# We choose a low number of bootstrap replicates in order to satisfy CRAN running times constraint.
# For practical applications, we recommend to use at least niter=501 or niter=1001.


# (1) Fit of a gamma distribution to serving size data
# using default method (maximum likelihood estimation)
# followed by parametric bootstrap
#
data(groundbeef)
x1 <- groundbeef$serving
f1 <- fitdist(x1, "gamma")
b1 <- bootdist(f1, niter=51)
print(b1)
plot(b1)
summary(b1)
quantile(b1)

# (2) non parametric bootstrap on the same fit
# with less iterations
#
b1b <- bootdist(f1, bootmethod="nonparam", niter=51) 
summary(b1b)
quantile(b1b)


# (3) Fit of a normal distribution on acute toxicity values of endosulfan in log10 for
# nonarthropod invertebrates, using maximum likelihood estimation
# to estimate what is called a species sensitivity distribution 
# (SSD) in ecotoxicology, followed by estimation of the 5 percent quantile value of 
# the fitted distribution, what is called the 5 percent hazardous concentration (HC5)
# in ecotoxicology, with its two-sided 95 percent confidence interval calculated by 
# parametric bootstrap
#
data(endosulfan)
ATV <- subset(endosulfan, group == "NonArthroInvert")$ATV
log10ATV <- log10(subset(endosulfan, group == "NonArthroInvert")$ATV)
fln <- fitdist(log10ATV, "norm")
bln <- bootdist(fln, bootmethod = "param", niter=51)
quantile(bln, probs = c(0.05, 0.1, 0.2))

Run the code above in your browser using DataLab