Learn R Programming

tolerance (version 0.4.0)

gamtol.int: Gamma (or Log-Gamma) Tolerance Intervals

Description

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

Usage

gamtol.int(x, alpha = 0.05, P = 0.99, side = 1,
           method = c("HE", "WBE", "EXACT"), m = 50, 
           log.gamma = FALSE)

Arguments

x
A vector of data which is distributed according to either a gamma distribution or a log-gamma 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).
method
The method for calculating the k-factors when using the normal approximation. The k-factor for the 1-sided tolerance intervals is performed exactly and thus the same for either method chosen. "HE" is the Howe method and is often viewe
m
The maximum number of subintervals to be used in the integrate function. This is necessary only for method = "EXACT". The larger the number, the more accurate the solution. Too low of a value can result in an error.
log.gamma
If TRUE, then the data is considered to be from a log-gamma distribution, in which case the output gives tolerance intervals for the log-gamma distribution. The default is FALSE.

Value

  • gamtol.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.

Details

Recall that if the random variable $X$ is distributed according to a log-gamma distribution, then the random variable $Y = ln(X)$ is distributed according to a gamma distribution.

References

Krishnamoorthy, K., Mathew, T., and Mukherjee, S. (2008), Normal-Based Methods for a Gamma Distribution: Prediction and Tolerance Intervals and Stress-Strength Reliability, Technometrics, 50, 69--78.

See Also

GammaDist, K.factor

Examples

Run this code
## 99\%/99\% 1-sided gamma tolerance intervals for a sample
## of size 50. 

set.seed(100)
x <- rgamma(50, 0.30, scale = 2)
out <- gamtol.int(x = x, alpha = 0.01, P = 0.99, side = 1,
                  method = "HE")
out

plottol(out, x, plot.type = "both", side = "upper", 
        x.lab = "Gamma Data")

Run the code above in your browser using DataLab