Learn R Programming

tolerance (version 0.4.0)

laptol.int: Laplace Tolerance Intervals

Description

Provides 1-sided or 2-sided tolerance intervals for data distributed according to a Laplace distribution.

Usage

laptol.int(x, alpha = 0.05, P = 0.99, side = 1)

Arguments

x
A vector of data which is distributed according to a Laplace distribution.
alpha
The level chosen such that 1-alpha is the confidence level.
P
The proportion of the population to be covered by this tolerance interval.
side
Whether a 1-sided or 2-sided tolerance interval is required (determined by side = 1 or side = 2, respectively).

Value

  • laptol.int returns a data frame with items:
  • alphaThe specified significance level.
  • PThe proportion of the population covered by this tolerance interval.
  • 1-sided.lowerThe 1-sided lower tolerance bound. This is given only if side = 1.
  • 1-sided.upperThe 1-sided upper tolerance bound. This is given only if side = 1.
  • 2-sided.lowerThe 2-sided lower tolerance bound. This is given only if side = 2.
  • 2-sided.upperThe 2-sided upper tolerance bound. This is given only if side = 2.

References

Bain, L. J. and Engelhardt, M. (1973), Interval Estimation for the Two Parameter Double Exponential Distribution, Technometrics, 15, 875--887.

Examples

Run this code
## First generate data from a Laplace distribution with location
## parameter 70 and scale parameter 3.

set.seed(100)
tmp <- runif(40)
x <- rep(70, 40) - sign(tmp - 0.5)*rep(3, 40)*
              log(2*ifelse(tmp < 0.5, tmp, 1-tmp))

## 95\%/90\% 1-sided Laplace tolerance intervals for the sample
## of size 40 generated above. 

out <- laptol.int(x = x, alpha = 0.05, P = 0.90, side = 1) 
out

plottol(out, x, plot.type = "hist", side = "two", 
        x.lab = "Laplace Data")

Run the code above in your browser using DataLab