# 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", "kaplan")
)
# Example 1 - Fitting a two-parametric weibull distribution:
rr_2p <- rank_regression(
x = prob_tbl_2p,
distribution = "weibull"
)
# Example 2 - Fitting a three-parametric lognormal distribution:
rr_3p <- rank_regression(
x = prob_tbl_3p,
distribution = "lognormal3",
conf_level = 0.99
)
# Example 3 - Fitting a three-parametric lognormal distribution using
# direction and control arguments:
rr_3p_control <- rank_regression(
x = prob_tbl_3p,
distribution = "lognormal3",
conf_level = 0.99,
direction = "y_on_x",
control = list(trace = TRUE, REPORT = 1)
)
# Example 4 - Fitting a three-parametric loglogistic distribution if multiple
# methods in estimate_cdf were specified:
rr_lists <- rank_regression(
x = prob_tbl_mult,
distribution = "loglogistic3",
conf_level = 0.90
)
Run the code above in your browser using DataLab