R/likelihood_functions.R
loglik_function.Rd
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.
A tibble
with class wt_reliability_data
returned by reliability_data.
Further arguments passed to or from other methods. Currently not used.
Optional vector of case weights. The length of wts
must be equal
to the number of observations in x
.
A vector of parameters. An overview of the distribution-specific parameters can be found in section 'Distributions'.
Supposed distribution of the random variable.
Returns the log-likelihood value for the parameters in dist_params
given
the data.
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.
distribution | dist_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\) | - |
Meeker, William Q; Escobar, Luis A., Statistical methods for reliability data, New York: Wiley series in probability and statistics, 1998
# 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"
)