Learn R Programming

weibulltools (version 2.0.0)

confint_betabinom: Beta Binomial Confidence Bounds for Quantiles and Probabilities

Description

This non-parametric approach computes the beta binomial bounds (BB) for quantiles and failure probabilities using a procedure similar to the calculation of probabilities in terms of (Median Ranks).

Usage

confint_betabinom(x, ...)

# S3 method for wt_model confint_betabinom( x, b_lives = c(0.01, 0.1, 0.5), bounds = c("two_sided", "lower", "upper"), conf_level = 0.95, direction = c("y", "x"), ... )

Value

A tibble with class wt_confint containing the following columns:

  • x : An ordered sequence of the lifetime characteristic regarding the failed units, starting at min(x) and ending up at max(x). With b_lives = c(0.01, 0.1, 0.5) the 1%, 10% and 50% quantiles are additionally included in x, but only if the specified probabilities are in the range of the estimated probabilities.

  • rank : Interpolated ranks as a function of probabilities, computed with the converted approximation formula of Benard.

  • prob : An ordered sequence of probabilities with specified b_lives included.

  • lower_bound : Provided, if bounds is one of "two_sided" or "lower". Lower limit of the confidence region with respect to direction, i.e. quantiles or probabilities.

  • upper_bound : Provided, if bounds is one of "two_sided" or "upper". Upper limit of the confidence region with respect to direction, i.e. quantiles or probabilities.

  • distribution : Specified distribution (determined when calling rank_regression).

  • bounds : Specified bound(s).

  • direction : Specified direction.

  • cdf_estimation_method : Specified method for the estimation of failure probabilities (determined when calling estimate_cdf).

Arguments

x

Object with class wt_model and one of the classes wt_model_estimation or wt_model_estimation_list returned from rank_regression.

...

Further arguments passed to or from other methods. Currently not used.

b_lives

A numeric vector indicating the probabilities p of the \(B_p\)-lives (quantiles) to be considered.

bounds

A character string specifying of which bounds have to be computed. One of "two_sided", "lower" or "upper".

conf_level

Confidence level of the interval.

direction

A character string specifying the direction of the confidence interval. One of "y" (failure probabilities) or "x" (quantiles).

Details

The difference to Median Ranks, i.e. finding the probability of rank j at a 50% level, is to determine the probability of rank j on another level, the specified confidence level.

Examples

Run this code
# Reliability data preparation:
## Data for two-parametric model:
data_2p <- reliability_data(
  shock,
  x = distance,
  status = status
)

## Data for three-parametric model:
data_3p <- reliability_data(
  alloy,
  x = cycles,
  status = status
)

# Probability estimation:
prob_tbl_2p <- estimate_cdf(
  data_2p,
  methods = "johnson"
)

prob_tbl_3p <- estimate_cdf(
  data_3p,
  methods = "johnson"
)

prob_tbl_mult <- estimate_cdf(
  data_3p,
  methods = c("johnson", "mr")
)

# Model estimation with rank_regression():
rr_2p <- rank_regression(
  prob_tbl_2p,
  distribution = "weibull"
)

rr_3p <- rank_regression(
  prob_tbl_3p,
  distribution = "lognormal3",
  conf_level = 0.90
)

rr_lists <- rank_regression(
  prob_tbl_mult,
  distribution = "loglogistic3",
  conf_level = 0.90
)

# Example 1 - Two-sided 95% confidence interval for probabilities ('y'):
conf_betabin_1 <- confint_betabinom(
  x = rr_2p,
  bounds = "two_sided",
  conf_level = 0.95,
  direction = "y"
)

# Example 2 - One-sided lower/upper 90% confidence interval for quantiles ('x'):
conf_betabin_2_1 <- confint_betabinom(
  x = rr_2p,
  bounds = "lower",
  conf_level = 0.90,
  direction = "x"
)

conf_betabin_2_2 <- confint_betabinom(
  x = rr_2p,
  bounds = "upper",
  conf_level = 0.90,
  direction = "x"
)

# Example 3 - Two-sided 90% confidence intervals for both directions using
# a three-parametric model:
conf_betabin_3_1 <- confint_betabinom(
  x = rr_3p,
  bounds = "two_sided",
  conf_level = 0.90,
  direction = "y"
)

conf_betabin_3_2 <- confint_betabinom(
  x = rr_3p,
  bounds = "two_sided",
  conf_level = 0.90,
  direction = "x"
)

# Example 4 - Confidence intervals if multiple methods in estimate_cdf, i.e.
# "johnson" and "mr", were specified:

conf_betabin_4 <- confint_betabinom(
  x = rr_lists,
  bounds = "two_sided",
  conf_level = 0.99,
  direction = "y"
)

Run the code above in your browser using DataLab