Learn R Programming

weibulltools (version 2.0.0)

delta_method: Delta Method for Parametric Lifetime Distributions

Description

This function applies the delta method for two- or three-parametric lifetime distributions that belong to the (log-)location-scale family.

Usage

delta_method(
  p,
  dist_params,
  dist_varcov,
  distribution = c("weibull", "lognormal", "loglogistic", "normal", "logistic", "sev",
    "weibull3", "lognormal3", "loglogistic3"),
  direction = c("y", "x")
)

Value

A numeric vector of estimated standard errors for quantiles or standardized quantiles (z-values).

Arguments

p

A numeric vector of probabilities or quantiles. If the standard errors of quantiles should be determined the corresponding probabilities have to be specified, and if the standard errors of standardized quantiles (z-values) should be computed corresponding quantiles are required.

dist_params

A (named) numeric vector of (log-)location-scale parameters returned from ml_estimation.

dist_varcov

A (named) numeric matrix of estimated variances and covariances returned from ml_estimation.

distribution

Supposed distribution of the random variable. Has to be in line with the specification made in ml_estimation.

direction

A character string specifying for which quantity the standard errors are calculated. One of "y" (if p are quantiles) or "x" (if p are probabilities).

Details

The delta method estimates the standard errors for quantities that can be written as non-linear functions of ML estimators. Hence, (log-)location-scale parameters as well as the variance-covariance matrix of these have to be estimated with maximum likelihood.

The estimated standard errors are needed to calculate Fisher's (normal approximation) confidence intervals. For confidence bounds on the probability, standard errors of the standardized quantiles (direction = "y") have to be computed (z-procedure) and for bounds on quantiles, standard errors of quantiles (direction = "x") are required. For more information see confint_fisher.

References

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

Examples

Run this code
# Reliability data preparation:
data <- reliability_data(
  shock,
  x = distance,
  status = status
)

# Parameter estimation using maximum likelihood:
mle <- ml_estimation(
  data,
  distribution = "weibull",
  conf_level = 0.95
)

# Example 1 - Standard errors of standardized quantiles:
delta_y <- delta_method(
  p = shock$distance,
  dist_params = mle$coefficients,
  dist_varcov = mle$varcov,
  distribution = "weibull",
  direction = "y"
)

# Example 2 - Standard errors of quantiles:
delta_x <- delta_method(
  p = seq(0.01, 0.99, 0.01),
  dist_params = mle$coefficients,
  dist_varcov = mle$varcov,
  distribution = "weibull",
  direction = "x"
)

Run the code above in your browser using DataLab