# 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