Learn R Programming

fitdistrplus (version 0.3-4)

bootdistcens: Bootstrap simulation of uncertainty for censored data

Description

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

Usage

bootdistcens(f, niter=1001)
## S3 method for class 'bootdistcens':
print(x,...)
## S3 method for class 'bootdistcens':
plot(x,...)
## S3 method for class 'bootdistcens':
summary(object,...)

Arguments

f
An object of class 'fitdistcens' result of the function fitdistcens.
niter
The number of samples drawn by bootstrap.
x
an object of class 'bootdistcens'.
object
an object of class 'bootdistcens'.
...
further arguments to be passed to generic methods

Value

  • bootdistcens returns an object of class 'bootdistcens', a list with 3 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.
  • CIbootstrap medians and 95 percent confidence percentile intervals of parameters.

Details

Samples are drawn by non parametric bootstrap (resampling with replacement from the data set). On each bootstrap sample the function mledist 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 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 mledist converges is also printed in the summary. The plot of an object of class 'bootdistcens' 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

fitdistcens and mledist.

Examples

Run this code
# (1) Fit of a normal distribution followed by nonparametric bootstrap
#
d1<-data.frame(
left=c(1.73,1.51,0.77,1.96,1.96,-1.4,-1.4,NA,-0.11,0.55,
    0.41,2.56,NA,-0.53,0.63,-1.4,-1.4,-1.4,NA,0.13),
right=c(1.73,1.51,0.77,1.96,1.96,0,-0.7,-1.4,-0.11,0.55,
    0.41,2.56,-1.4,-0.53,0.63,0,-0.7,NA,-1.4,0.13))
f1<-fitdistcens(d1, "norm")
b1<-bootdistcens(f1)
b1
summary(b1)
plot(b1)

# (2) Fit of a gamma distribution followed by nonparametric bootstrap
#
d3<-data.frame(left=10^(d1$left),right=10^(d1$right))
f3 <- fitdistcens(d3,"gamma")
b3 <- bootdistcens(f3,niter=101)
summary(b3)
plot(b3)

# (3) Fit of a gamma distribution followed by nonparametric bootstrap
# with control of the optimization method
#
f3BFGS <- fitdistcens(d3,"gamma",optim.method="L-BFGS-B",lower=c(0,0))
b3BFGS <- bootdistcens(f3BFGS,niter=101)
summary(b3BFGS)
plot(b3BFGS)

# (4) Estimation of the standard deviation of a normal distribution 
# by maximum likelihood with the mean fixed at 0.1 using the argument fix.arg
# followed by nonparametric bootstrap
#
f1b <- fitdistcens(d1, "norm", start=list(sd=1.5),fix.arg=list(mean=0.1))
b1b<-bootdistcens(f1b,niter=101)
summary(b1b)
plot(b1b)

Run the code above in your browser using DataLab