Learn R Programming

EnvStats (version 2.1.0)

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

Value

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

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, \ldots, x_n)$ be a vector of $n$ observations from an Weibull distribution with parameters shape=$\alpha$ and scale=$\beta$. Estimation Maximum Likelihood Estimation (method="mle") The maximum likelihood estimators (mle's) of $\alpha$ and $\beta$ are the solutions of the simultaneous equations (Forbes et al., 2011): $$\hat{\alpha}_{mle} = \frac{n}{{(1/\hat{\beta}_{mle})^{\hat{\alpha}_{mle}} \sum_{i=1}^n [x_i^{\hat{\alpha}_{mle}} log(x_i)]} - \sum_{i=1}^n log(x_i) } \;\;\;\; (1)$$ $$\hat{\beta}_{mle} = [\frac{1}{n} \sum_{i=1}^n x_i^{\hat{\alpha}_{mle}}]^{1/\hat{\alpha}_{mle}} \;\;\;\; (2)$$ Method of Moments Estimation (method="mme") The method of moments estimator (mme) of $\alpha$ is computed by solving the equation: $$\frac{s}{\bar{x}} = {\frac{\Gamma[(\hat{\alpha}_{mme} + 2)/\hat{\alpha}_{mme}]}{{\Gamma[(\hat{\alpha}_{mme} + 1)/\hat{\alpha}_{mme}] }^2} - 1 }^{1/2} \;\;\;\; (3)$$ and the method of moments estimator (mme) of $\beta$ is then computed as: $$\hat{\beta}_{mme} = \frac{\bar{x}}{\Gamma[(\hat{\alpha}_{mme} + 1)/\hat{\alpha}_{mme}]} \;\;\;\; (4)$$ where $$\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \;\;\;\; (5)$$ $$s^2_m = \frac{1}{n} \sum_{i=1}^n (x_i - \bar{x})^2 \;\;\;\; (6)$$ and $\Gamma()$ 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} \sum_{i=1}^n (x_i - \bar{x})^2 \;\;\;\; (7)$$

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

Weibull, Exponential, EVD, estimate.object.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab