Learn R Programming

fitdistrplus (version 0.1-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,...)
## S3 method for class 'bootdist':
plot(x,...)
## S3 method for class 'bootdist':
summary(object,...)

Arguments

f
An object of class 'fitdist' result of the function fitdist.
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 4 components,
  • estima data frame containing the boostrapped values of parameters.
  • converga vector containing the codes for convergence obtained when using mledist on each bootstraped data set or NULL if mmedist is used.
  • methodA character string coding for the type of resampling : "param" for a parametric resampling and "nonparam" for a nonparametric resampling of data.
  • CIbootstrap medians and 95 percent confidence percentile intervals of parameters.

Details

Samples are drawn by parametric bootstrap (resampling from the distribution fitted by fitdist) or non parametric bootstrap (resampling with replacement from the data set). On each bootstrap sample the function mledist or the function mmedist (according to the component f$method of the object of class 'fitdist') is used to estimate bootstrapped values of parameters. When mledist fails to converge, NA values are returned. Medians and 2.5 and 97.5 percentiles are computed by removing NA values. The number of iterations for which mledist converges is printed in the summary with the medians and the 95 percent confidence intervals of parameters (2.5 and 97.5 percentiles). 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 and mmedist.

Examples

Run this code
x1<-c(6.4,13.3,4.1,1.3,14.1,10.6,9.9,9.6,15.3,22.1,13.4,
13.2,8.4,6.3,8.9,5.2,10.9,14.4)

f1<-fitdist(x1,"norm",method="mle")
b1<-bootdist(f1)
print(b1)
plot(b1)
summary(b1)

b1b<-bootdist(f1,bootmethod="nonparam")
summary(b1b)

f1b<-fitdist(x1,"gamma",method="mle")
b1b<-bootdist(f1b)
plot(b1b)

x2<-c(rep(4,1),rep(2,3),rep(1,7),rep(0,12))
f2<-fitdist(x2,"pois",method="mme")
b2<-bootdist(f2)
plot(b2,pch=16)
summary(b2)

Run the code above in your browser using DataLab