delta_method: Delta Method for Parametric Lifetime Distributions

View source: R/delta_method.R

delta_methodR Documentation

Delta Method for Parametric Lifetime Distributions

Description

This function applies the delta method to a parametric lifetime distribution.

Usage

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

Arguments

x

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

The parameters (coefficients) returned by ml_estimation.

dist_varcov

The variance-covariance-matrix (varcov) returned by 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. "y" if x are quantiles or "x" if x are probabilities.

p

[Soft-deprecated]: Use x instead.

Details

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

The estimated standard errors are used 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.

Value

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

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(
  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(
  x = shock$distance,
  dist_params = mle$coefficients,
  dist_varcov = mle$varcov,
  distribution = "weibull",
  direction = "y"
)

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


weibulltools documentation built on April 5, 2023, 5:10 p.m.