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(),
  ...
)

Arguments

x

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.

status

A vector of binary data (0 or 1) indicating whether a unit is a right censored observation (= 0) or a failure (= 1).

distribution

Supposed distribution of the random variable.

wts

Optional vector of case weights. The length of wts must be equal to the number of observations in x.

conf_level

Confidence level of the interval.

start_dist_params

Optional vector with initial values of the (log-)location-scale parameters.

control

A list of control parameters (see 'Details' and optim).

...

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

Value

A list with classes wt_model, wt_ml_estimation and wt_model_estimationwhich 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.

Details

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.

References

Meeker, William Q; Escobar, Luis A., Statistical methods for reliability data, New York: Wiley series in probability and statistics, 1998

See also

Examples

# 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"
)