
tolIntNpar(x, coverage, conf.level, cov.type = "content",
ltl.rank = ifelse(ti.type == "upper", 0, 1),
n.plus.one.minus.utl.rank = ifelse(ti.type == "lower", 0, 1),
lb = -Inf, ub = Inf, ti.type = "two-sided")
NA
), undefined (NaN
), and
infinite (Inf
, -Inf
) values are allowed but will be removed.coverage=0.95
. If cov.type="content"
, you must
supply a value for coverage
or a vconf.level=0.95
. If cov.type="content"
,
you must supply a value for coverage
"content"
($\beta$-content; the default), and
"expectation"
($\beta$-expectation). See the DETAILS section for more
iti.type="two-sided"
or ti.type="lower"
,
the default value is ltl.rank=1
(implying the minin.plus.one.minus.utl.rank=1
(the default) means use the
first largest value of x
, and in gelb=-Inf
and
ub=Inf
. If you are constructing a tolerance interval for a distribution
that you know has a lower bound other than -Inf
"two-sided"
(the default), "lower"
, and
"upper"
."estimate"
containing the estimated parameters,
the tolerance interval, and other information. See estimate.object
for details.tolIntNpar
, the argument
ltl.rank
corresponds to $u$, and the argument n.plus.one.minus.utl.rank
corresponds to $w$.
If we allow $u=0$ and $w=0$ and define lower and upper bounds as:
shape1=
$v-u$ and
shape2=
$w+u$ when the unknown distribution is continuous.
Computations for a $\beta$-Content Tolerance Interval
For a $\beta$-content tolerance interval, if the coverage $C = \beta$ is specified,
then the associated confidence level $(1-\alpha)100%$ is computed as:
shape1=
$\delta$ and
shape2=
$\gamma$ evaluated at $y$.
Similarly, if the confidence level associated with the tolerance interval is specified as
$(1-\alpha)100%$, then the coverage $C = \beta$ is computed as:
shape1=
$\delta$
and shape2=
$\gamma$.
Computations for a $\beta$-Expectation Tolerance Interval
For a $\beta$-expectation tolerance interval, the expected coverage is simply
the mean of a beta random variable with parameters
shape1=
$v-u$ and shape2=
$w+u$, which is given by:
size=
$N$
and prob=
$\beta$. Hence the expected proportion of future observations
that fall into this interval is $\beta 100%$ and is independent of the value of $N$.
See the help file for predIntNpar
for more information on constructing
a nonparametric prediction interval.eqnpar
, estimate.object
,
tolIntNparN
, Tolerance Intervals,
Estimating Distribution Parameters, Estimating Distribution Quantiles.# Generate 20 observations from a \link[=LognormalMixAlt]{lognormal mixture distribution}
# with parameters mean1=1, cv1=0.5, mean2=5, cv2=1, and p.mix=0.1.
# The exact two-sided interval that contains 90\% of this distribution is given by:
# [0.682312, 13.32052]. Use tolIntNpar to construct a two-sided 90\%
# \eqn{\beta}-content tolerance interval. Note that the associated confidence level
# is only 61%. A larger sample size is required to obtain a larger confidence
# level (see the help file for \link{tolIntNparN}).
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(23)
dat <- rlnormMixAlt(20, 1, 0.5, 5, 1, 0.1)
tolIntNpar(dat, coverage = 0.9)
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: None
#
#Data: dat
#
#Sample Size: 20
#
#Tolerance Interval Coverage: 90%
#
#Coverage Type: content
#
#Tolerance Interval Method: Exact
#
#Tolerance Interval Type: two-sided
#
#Confidence Level: 60.8253%
#
#Tolerance Limit Rank(s): 1 20
#
#Tolerance Interval: LTL = 0.5035035
# UTL = 9.9504662
#----------
# Clean up
rm(dat)
#----------
# Reproduce Example 17-4 on page 17-21 of USEPA (2009). This example uses
# copper concentrations (ppb) from 3 background wells to set an upper
# limit for 2 compliance wells. The maximum value from the 3 wells is set
# to the 95% confidence upper tolerance limit, and we need to determine the
# coverage of this tolerance interval. The data are stored in EPA.92c.copper2.df.
# Note that even though these data are Type I left singly censored, it is still
# possible to compute an upper tolerance interval using any of the uncensored
# observations as the upper limit.
EPA.92c.copper2.df
# Copper.orig Copper Censored Month Well Well.type
#1 <5 5.0 TRUE 1 1 Background
#2 <5 5.0 TRUE 2 1 Background
#3 7.5 7.5 FALSE 3 1 Background
#...
#9 9.2 9.2 FALSE 1 2 Background
#10 <5 5.0 TRUE 2 2 Background
#11 <5 5.0 TRUE 3 2 Background
#...
#17 <5 5.0 TRUE 1 3 Background
#18 5.4 5.4 FALSE 2 3 Background
#19 6.7 6.7 FALSE 3 3 Background
#...
#29 6.2 6.2 FALSE 5 4 Compliance
#30 <5 5.0 TRUE 6 4 Compliance
#31 7.8 7.8 FALSE 7 4 Compliance
#...
#38 <5 5.0 TRUE 6 5 Compliance
#39 5.6 5.6 FALSE 7 5 Compliance
#40 <5 5.0 TRUE 8 5 Compliance
with(EPA.92c.copper2.df,
tolIntNpar(Copper[Well.type=="Background"],
conf.level = 0.95, lb = 0, ti.type = "upper"))
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: None
#
#Data: Copper[Well.type == "Background"]
#
#Sample Size: 24
#
#Tolerance Interval Coverage: 88.26538%
#
#Coverage Type: content
#
#Tolerance Interval Method: Exact
#
#Tolerance Interval Type: upper
#
#Confidence Level: 95%
#
#Tolerance Limit Rank(s): 24
#
#Tolerance Interval: LTL = 0.0
# UTL = 9.2
#----------
# Repeat the last example, except compute an upper
# \eqn{\beta}-expectation tolerance interval:
with(EPA.92c.copper2.df,
tolIntNpar(Copper[Well.type=="Background"],
cov.type = "expectation", lb = 0, ti.type = "upper"))
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: None
#
#Data: Copper[Well.type == "Background"]
#
#Sample Size: 24
#
#Tolerance Interval Coverage: 96%
#
#Coverage Type: expectation
#
#Tolerance Interval Method: Exact
#
#Tolerance Interval Type: upper
#
#Tolerance Limit Rank(s): 24
#
#Tolerance Interval: LTL = 0.0
# UTL = 9.2
Run the code above in your browser using DataLab