Learn R Programming

VGAM (version 1.1-9)

weibullR: Weibull Distribution Family Function

Description

Maximum likelihood estimation of the 2-parameter Weibull distribution. No observations should be censored.

Usage

weibullR(lscale = "loglink", lshape = "loglink",
         iscale = NULL,   ishape = NULL, lss = TRUE, nrfs = 1,
         probs.y = c(0.2, 0.5, 0.8), imethod = 1, zero = "shape")

Value

An object of class "vglmff"

(see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Arguments

lshape, lscale

Parameter link functions applied to the (positive) shape parameter (called \(a\) below) and (positive) scale parameter (called \(b\) below). See Links for more choices.

ishape, iscale

Optional initial values for the shape and scale parameters.

nrfs

Currently this argument is ignored. Numeric, of length one, with value in \([0,1]\). Weighting factor between Newton-Raphson and Fisher scoring. The value 0 means pure Newton-Raphson, while 1 means pure Fisher scoring. The default value uses a mixture of the two algorithms, and retaining positive-definite working weights.

imethod

Initialization method used if there are censored observations. Currently only the values 1 and 2 are allowed.

zero, probs.y, lss

Details at CommonVGAMffArguments.

Author

T. W. Yee

Warning

This function is under development to handle other censoring situations. The version of this function which will handle censored data will be called cenweibull(). It is currently being written and will use SurvS4 as input. It should be released in later versions of VGAM.

If the shape parameter is less than two then misleading inference may result, e.g., in the summary and vcov of the object.

Details

The Weibull density for a response \(Y\) is $$f(y;a,b) = a y^{a-1} \exp[-(y/b)^a] / (b^a)$$ for \(a > 0\), \(b > 0\), \(y > 0\). The cumulative distribution function is $$F(y;a,b) = 1 - \exp[-(y/b)^a].$$ The mean of \(Y\) is \(b \, \Gamma(1+ 1/a)\) (returned as the fitted values), and the mode is at \(b\,(1-1/a)^{1/a}\) when \(a>1\). The density is unbounded for \(a<1\). The \(k\)th moment about the origin is \(E(Y^k) = b^k \, \Gamma(1+ k/a)\). The hazard function is \(a t^{a-1} / b^a\).

This VGAM family function currently does not handle censored data. Fisher scoring is used to estimate the two parameters. Although the expected information matrices used here are valid in all regions of the parameter space, the regularity conditions for maximum likelihood estimation are satisfied only if \(a>2\) (according to Kleiber and Kotz (2003)). If this is violated then a warning message is issued. One can enforce \(a>2\) by choosing lshape = logofflink(offset = -2). Common values of the shape parameter lie between 0.5 and 3.5.

Summarized in Harper et al. (2011), for inference, there are 4 cases to consider. If \(a \le 1\) then the MLEs are not consistent (and the smallest observation becomes a hyperefficient solution for the location parameter in the 3-parameter case). If \(1 < a < 2\) then MLEs exist but are not asymptotically normal. If \(a = 2\) then the MLEs exist and are normal and asymptotically efficient but with a slower convergence rate than when \(a > 2\). If \(a > 2\) then MLEs have classical asymptotic properties.

The 3-parameter (location is the third parameter) Weibull can be estimated by maximizing a profile log-likelihood (see, e.g., Harper et al. (2011) and Lawless (2003)), else try gev which is a better parameterization.

References

Kleiber, C. and Kotz, S. (2003). Statistical Size Distributions in Economics and Actuarial Sciences, Hoboken, NJ, USA: Wiley-Interscience.

Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1994). Continuous Univariate Distributions, 2nd edition, Volume 1, New York: Wiley.

Lawless, J. F. (2003). Statistical Models and Methods for Lifetime Data, 2nd ed. Hoboken, NJ, USA: John Wiley & Sons.

Rinne, Horst. (2009). The Weibull Distribution: A Handbook. Boca Raton, FL, USA: CRC Press.

Gupta, R. D. and Kundu, D. (2006). On the comparison of Fisher information of the Weibull and GE distributions, Journal of Statistical Planning and Inference, 136, 3130--3144.

Harper, W. V. and Eschenbach, T. G. and James, T. R. (2011). Concerns about Maximum Likelihood Estimation for the Three-Parameter Weibull Distribution: Case Study of Statistical Software, The American Statistician, 65(1), 44--54.

Smith, R. L. (1985). Maximum likelihood estimation in a class of nonregular cases. Biometrika, 72, 67--90.

Smith, R. L. and Naylor, J. C. (1987). A comparison of maximum likelihood and Bayesian estimators for the three-parameter Weibull distribution. Applied Statistics, 36, 358--369.

See Also

weibull.mean, dweibull, truncweibull, gev, lognormal, expexpff, maxwell, rayleigh, gumbelII.

Examples

Run this code
wdata <- data.frame(x2 = runif(nn <- 1000))  # Complete data
wdata <- transform(wdata,
            y1 = rweibull(nn, exp(1), scale = exp(-2 + x2)),
            y2 = rweibull(nn, exp(2), scale = exp( 1 - x2)))
fit <- vglm(cbind(y1, y2) ~ x2, weibullR, wdata, trace = TRUE)
coef(fit, matrix = TRUE)
vcov(fit)
summary(fit)

Run the code above in your browser using DataLab