Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

eweibull

Estimate Parameters of a Weibull Distribution


Description

Estimate the shape and scale parameters of a Weibull distribution.

Usage

eweibull(x, method = "mle")

Arguments

x

numeric vector of observations. Missing (NA), undefined (NaN), and infinite (Inf, -Inf) values are allowed but will be removed.

method

character string specifying the method of estimation. Possible values are "mle" (maximum likelihood; the default), "mme" (methods of moments), and "mmue" (method of moments based on the unbiased estimator of variance). See the DETAILS section for more information on these estimation methods.

Details

If x contains any missing (NA), undefined (NaN) or infinite (Inf, -Inf) values, they will be removed prior to performing the estimation.

Let \underline{x} = (x_1, x_2, …, x_n) be a vector of n observations from an Weibull distribution with parameters shape=α and scale=β.

Estimation

Maximum Likelihood Estimation (method="mle")
The maximum likelihood estimators (mle's) of α and β are the solutions of the simultaneous equations (Forbes et al., 2011):

\hat{α}_{mle} = \frac{n}{\{(1/\hat{β}_{mle})^{\hat{α}_{mle}} ∑_{i=1}^n [x_i^{\hat{α}_{mle}} log(x_i)]\} - ∑_{i=1}^n log(x_i) } \;\;\;\; (1)

\hat{β}_{mle} = [\frac{1}{n} ∑_{i=1}^n x_i^{\hat{α}_{mle}}]^{1/\hat{α}_{mle}} \;\;\;\; (2)


Method of Moments Estimation (method="mme")
The method of moments estimator (mme) of α is computed by solving the equation:

\frac{s}{\bar{x}} = \{\frac{Γ[(\hat{α}_{mme} + 2)/\hat{α}_{mme}]}{\{Γ[(\hat{α}_{mme} + 1)/\hat{α}_{mme}] \}^2} - 1 \}^{1/2} \;\;\;\; (3)

and the method of moments estimator (mme) of β is then computed as:

\hat{β}_{mme} = \frac{\bar{x}}{Γ[(\hat{α}_{mme} + 1)/\hat{α}_{mme}]} \;\;\;\; (4)

where

\bar{x} = \frac{1}{n} ∑_{i=1}^n x_i \;\;\;\; (5)

s^2_m = \frac{1}{n} ∑_{i=1}^n (x_i - \bar{x})^2 \;\;\;\; (6)

and Γ() denotes the gamma function.

Method of Moments Estimation Based on the Unbiased Estimator of Variance (method="mmue")
The method of moments estimators based on the unbiased estimator of variance are exactly the same as the method of moments estimators given in equations (3-6) above, except that the method of moments estimator of variance in equation (6) is replaced with the unbiased estimator of variance:

s^2 = \frac{1}{n-1} ∑_{i=1}^n (x_i - \bar{x})^2 \;\;\;\; (7)

Value

a list of class "estimate" containing the estimated parameters and other information. See
estimate.object for details.

Note

The Weibull distribution is named after the Swedish physicist Waloddi Weibull, who used this distribution to model breaking strengths of materials. The Weibull distribution has been extensively applied in the fields of reliability and quality control.

The exponential distribution is a special case of the Weibull distribution: a Weibull random variable with parameters shape=1 and scale=β is equivalent to an exponential random variable with parameter rate=1/β.

The Weibull distribution is related to the Type I extreme value (Gumbel) distribution as follows: if X is a random variable from a Weibull distribution with parameters shape=α and scale=β, then

Y = -log(X) \;\;\;\; (10)

is a random variable from an extreme value distribution with parameters location=-log(β) and scale=1/α.

Author(s)

Steven P. Millard (EnvStats@ProbStatInfo.com)

References

Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions. Fourth Edition. John Wiley and Sons, Hoboken, NJ.

Johnson, N. L., S. Kotz, and N. Balakrishnan. (1994). Continuous Univariate Distributions, Volume 1. Second Edition. John Wiley and Sons, New York.

See Also

Examples

# Generate 20 observations from a Weibull distribution with parameters 
  # shape=2 and scale=3, then estimate the parameters via maximum likelihood. 
  # (Note: the call to set.seed simply allows you to reproduce this example.)

  set.seed(250) 
  dat <- rweibull(20, shape = 2, scale = 3) 
  eweibull(dat) 

  #Results of Distribution Parameter Estimation
  #--------------------------------------------
  #
  #Assumed Distribution:            Weibull
  #
  #Estimated Parameter(s):          shape = 2.673098
  #                                 scale = 3.047762
  #
  #Estimation Method:               mle
  #
  #Data:                            dat
  #
  #Sample Size:                     20

  #----------

  # Use the same data as in previous example, and compute the method of 
  # moments estimators based on the unbiased estimator of variance:

  eweibull(dat, method = "mmue") 

  #Results of Distribution Parameter Estimation
  #--------------------------------------------
  #
  #Assumed Distribution:            Weibull
  #
  #Estimated Parameter(s):          shape = 2.528377
  #                                 scale = 3.052507
  #
  #Estimation Method:               mmue
  #
  #Data:                            dat
  #
  #Sample Size:                     20

  #----------

  # Clean up
  #---------
  rm(dat)

EnvStats

Package for Environmental Statistics, Including US EPA Guidance

v2.4.0
GPL (>= 3)
Authors
Steven P. Millard [aut], Alexander Kowarik [ctb, cre] (<https://orcid.org/0000-0001-8598-4130>)
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.