# Vectors:
obs <- seq(10000, 100000, 10000)
status_1 <- c(0, 1, 1, 0, 0, 0, 1, 0, 1, 0)
cycles <- alloy$cycles
status_2 <- alloy$status
# Model estimation with ml_estimation():
ml <- ml_estimation(
x = obs,
status = status_1,
distribution = "weibull",
conf_level = 0.90
)
ml_2 <- ml_estimation(
x = cycles,
status = status_2,
distribution = "lognormal3"
)
# Example 1 - Two-sided 95% confidence interval for probabilities ('y'):
conf_fisher_1 <- confint_fisher(
x = obs,
status = status_1,
dist_params = ml$coefficients,
dist_varcov = ml$varcov,
distribution = "weibull",
bounds = "two_sided",
conf_level = 0.95,
direction = "y"
)
# Example 2 - One-sided lower/upper 90% confidence interval for quantiles ('x'):
conf_fisher_2_1 <- confint_fisher(
x = obs,
status = status_1,
dist_params = ml$coefficients,
dist_varcov = ml$varcov,
distribution = "weibull",
bounds = "lower",
conf_level = 0.90,
direction = "x"
)
conf_fisher_2_2 <- confint_fisher(
x = obs,
status = status_1,
dist_params = ml$coefficients,
dist_varcov = ml$varcov,
distribution = "weibull",
bounds = "upper",
conf_level = 0.90,
direction = "x"
)
# Example 3 - Two-sided 90% confidence intervals for both directions using
# a three-parametric model:
conf_fisher_3_1 <- confint_fisher(
x = cycles,
status = status_2,
dist_params = ml_2$coefficients,
dist_varcov = ml_2$varcov,
distribution = "lognormal3",
bounds = "two_sided",
conf_level = 0.90,
direction = "y"
)
conf_fisher_3_2 <- confint_fisher(
x = cycles,
status = status_2,
dist_params = ml_2$coefficients,
dist_varcov = ml_2$varcov,
distribution = "lognormal3",
bounds = "two_sided",
conf_level = 0.90,
direction = "x"
)
Run the code above in your browser using DataLab