This function computes the log-likelihood value with respect to a given set of parameters. In terms of Maximum Likelihood Estimation this function can be optimized (optim) to estimate the parameters and variance-covariance matrix of the parameters.

loglik_function(x, ...)

# S3 method for wt_reliability_data
loglik_function(
  x,
  wts = rep(1, nrow(x)),
  dist_params,
  distribution = c("weibull", "lognormal", "loglogistic", "sev", "normal", "logistic",
    "weibull3", "lognormal3", "loglogistic3", "exponential", "exponential2"),
  ...
)

Arguments

x

A tibble with class wt_reliability_data returned by reliability_data.

...

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

wts

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

dist_params

A vector of parameters. An overview of the distribution-specific parameters can be found in section 'Distributions'.

distribution

Supposed distribution of the random variable.

Value

Returns the log-likelihood value for the parameters in dist_params given the data.

Distributions

The following table summarizes the available distributions and their parameters

  • location parameter \(\mu\),

  • scale parameter \(\sigma\) or \(\theta\) and

  • threshold parameter \(\gamma\).

The order within dist_params is given in the table header.

distributiondist_params[1]dist_params[2]dist_params[3]
"sev"\(\mu\)\(\sigma\)-
"weibull"\(\mu\)\(\sigma\)-
"weibull3"\(\mu\)\(\sigma\)\(\gamma\)
"normal"\(\mu\)\(\sigma\)-
"lognormal"\(\mu\)\(\sigma\)-
"lognormal3"\(\mu\)\(\sigma\)\(\gamma\)
"logistic"\(\mu\)\(\sigma\)-
"loglogistic"\(\mu\)\(\sigma\)-
"loglogistic3"\(\mu\)\(\sigma\)\(\gamma\)
"exponential"\(\theta\)--
"exponential2"\(\theta\)\(\gamma\)-

References

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

Examples

# Reliability data preparation:
data <- reliability_data(
  alloy,
  x = cycles,
  status = status
)

# Example 1 - Evaluating Log-Likelihood function of two-parametric weibull:
loglik_weib <- loglik_function(
  x = data,
  dist_params = c(5.29, 0.33),
  distribution = "weibull"
)

# Example 2 - Evaluating Log-Likelihood function of three-parametric weibull:
loglik_weib3 <- loglik_function(
  x = data,
  dist_params = c(4.54, 0.76, 92.99),
  distribution = "weibull3"
)