R/ml_estimation.R
ml_estimation.default.Rd
This function estimates the parameters of a parametric lifetime distribution for complete and (multiple) right-censored data. The parameters are determined in the frequently used (log-)location-scale parameterization.
For the Weibull, estimates are additionally transformed such that they are in line with the parameterization provided by the stats package (see Weibull).
# S3 method for default
ml_estimation(
x,
status,
distribution = c("weibull", "lognormal", "loglogistic", "sev", "normal", "logistic",
"weibull3", "lognormal3", "loglogistic3", "exponential", "exponential2"),
wts = rep(1, length(x)),
conf_level = 0.95,
start_dist_params = NULL,
control = list(),
...
)
A numeric vector which consists of lifetime data. Lifetime data could be every characteristic influencing the reliability of a product, e.g. operating time (days/months in service), mileage (km, miles), load cycles.
A vector of binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1).
Supposed distribution of the random variable.
Optional vector of case weights. The length of wts
must be equal
to the number of observations in x
.
Confidence level of the interval.
Optional vector with initial values of the (log-)location-scale parameters.
A list of control parameters (see 'Details' and optim).
Further arguments passed to or from other methods. Currently not used.
A list with classes wt_model
, wt_ml_estimation
and wt_model_estimation
which contains:
coefficients
: A named vector of estimated coefficients (parameters of the
assumed distribution). Note: The parameters are given in the
(log-)location-scale-parameterization.
confint
: Confidence intervals for the (log-)location-scale parameters.
shape_scale_coefficients
: Only included if distribution
is "weibull"
or "weibull3"
(parameterization used in Weibull).
shape_scale_confint
: Only included if distribution
is "weibull"
or "weibull3"
. Confidence intervals for scale \(\eta\) and shape \(\beta\)
(and threshold \(\gamma\) if distribution = "weibull3"
).
varcov
: Estimated variance-covariance matrix of (log-)location-scale parameters.
logL
: The log-likelihood value.
aic
: Akaike Information Criterion.
bic
: Bayesian Information Criterion.
data
: A tibble
with columns x
and status
.
distribution
: Specified distribution.
Within ml_estimation
, optim is called with method = "BFGS"
and control$fnscale = -1
to estimate the parameters that maximize the
log-likelihood (see loglik_function). For threshold models, the profile
log-likelihood is maximized in advance (see loglik_profiling). Once the
threshold parameter is determined, the threshold model is treated like a
distribution without threshold (lifetime is reduced by threshold estimate)
and the general optimization routine is applied.
Normal approximation confidence intervals for the parameters are computed as well.
Meeker, William Q; Escobar, Luis A., Statistical methods for reliability data, New York: Wiley series in probability and statistics, 1998
# 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
# Example 1 - Fitting a two-parametric weibull distribution:
ml <- ml_estimation(
x = obs,
status = status_1,
distribution = "weibull",
conf_level = 0.90
)
# Example 2 - Fitting a three-parametric lognormal distribution:
ml_2 <- ml_estimation(
x = cycles,
status = status_2,
distribution = "lognormal3"
)