This method applies the expectation-maximization (EM) algorithm to estimate the parameters of a univariate Weibull mixture model. See 'Details'.

# S3 method for default
mixmod_em(
  x,
  status,
  distribution = "weibull",
  conf_level = 0.95,
  k = 2,
  method = "EM",
  n_iter = 100L,
  conv_limit = 1e-06,
  diff_loglik = 0.01,
  ...
)

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

"weibull" until further distributions are implemented.

conf_level

Confidence level for the intervals of the Weibull parameters of every component k.

k

Number of mixture components.

method

"EM" until other methods are implemented.

n_iter

Integer defining the maximum number of iterations.

conv_limit

Numeric value defining the convergence limit.

diff_loglik

Numeric value defining the maximum difference between log-likelihood values, which seems permissible.

...

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

Value

A list with classes wt_model and wt_mixmod_em. The length of the list depends on the number of specified subgroups k. The first k lists contain information provided by ml_estimation. The values of logL, aicand bic are the results of a weighted log-likelihood, where the weights are the posterior probabilities determined by the algorithm. The last list summarizes further results of the EM algorithm and is therefore called em_results. It contains the following elements:

  • a_priori : A vector with estimated prior probabilities.

  • a_posteriori : A matrix with estimated posterior probabilities.

  • groups : Numeric vector specifying the group membership of every observation.

  • logL : The value of the complete log-likelihood.

  • aic : Akaike Information Criterion.

  • bic : Bayesian Information Criterion.

Details

The EM algorithm is an iterative algorithm for which starting values must be defined. Starting values can be provided for the unknown parameter vector as well as for the posterior probabilities. This implementation employs initial values for the posterior probabilities. These are assigned randomly by using the Dirichlet distribution, the conjugate prior of a multinomial distribution (see Mr. Gelissen's blog post listed under references).

M-Step : On the basis of the initial posterior probabilities, the parameter vector is estimated with Newton-Raphson.

E-Step : The actual estimated parameter vector is used to perform an update of the posterior probabilities.

This procedure is repeated until the complete log-likelihood has converged.

References

See also

Examples

# Vectors:
hours <- voltage$hours
status <- voltage$status

# Example 1 - EM algorithm with k = 2:
mix_mod_em <- mixmod_em(
  x = hours,
  status = status,
  distribution = "weibull",
  conf_level = 0.95,
  k = 2,
  n_iter = 150
)

#' # Example 2 - Maximum likelihood is applied when k = 1:
mix_mod_em_2 <- mixmod_em(
  x = hours,
  status = status,
  distribution = "weibull",
  conf_level = 0.95,
  k = 1,
  method = "EM",
  n_iter = 150
)