weibull.mean: Weibull Distribution Family Function, Parameterized by the...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/family.censored.R

Description

Maximum likelihood estimation of the 2-parameter Weibull distribution. The mean is one of the parameters. No observations should be censored.

Usage

1
2
3
weibull.mean(lmean = "loglink", lshape = "loglink", imean = NULL,
             ishape = NULL, probs.y = c(0.2, 0.5, 0.8),
             imethod = 1, zero = "shape")

Arguments

lmean, lshape

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

imean, ishape

Optional initial values for the mean and shape parameters.

imethod, zero, probs.y

Details at CommonVGAMffArguments.

Details

See weibullR for most of the details for this family function too. The mean of Y is b * gamma(1+ 1/a) (returned as the fitted values), and this is the first parameter (a loglink link is the default because it is positive). The other parameter is the positive shape paramter a, also having a default loglink link.

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.

Value

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

Note

See weibullR for more details. This VGAM family function handles multiple responses.

Author(s)

T. W. Yee

See Also

weibullR, dweibull, truncweibull, gev, lognormal, expexpff, maxwell, rayleigh, gumbelII.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
wdata <- data.frame(x2 = runif(nn <- 1000))  # Complete data
wdata <- transform(wdata, mu     = exp(-1 + 1 * x2),
                          x3     = rnorm(nn),
                          shape1 = exp(1),
                          shape2 = exp(2))
wdata <- transform(wdata,
  y1 = rweibull(nn, shape = shape1, scale = mu / gamma(1 + 1/shape1)),
  y2 = rweibull(nn, shape = shape2, scale = mu / gamma(1 + 1/shape2)))
fit <- vglm(cbind(y1, y2) ~ x2 + x3, weibull.mean, data = wdata, trace = TRUE)
coef(fit, matrix = TRUE)
sqrt(diag(vcov(fit)))  # SEs
summary(fit, presid = FALSE)

Example output

Loading required package: stats4
Loading required package: splines
VGLM    linear loop  1 :  loglikelihood = 651.76426
VGLM    linear loop  2 :  loglikelihood = 859.00833
VGLM    linear loop  3 :  loglikelihood = 901.09161
VGLM    linear loop  4 :  loglikelihood = 901.68797
VGLM    linear loop  5 :  loglikelihood = 901.6885
VGLM    linear loop  6 :  loglikelihood = 901.68852
VGLM    linear loop  7 :  loglikelihood = 901.68852
VGLM    linear loop  8 :  loglikelihood = 901.68852
              loge(mean1) loge(shape1)  loge(mean2) loge(shape2)
(Intercept) -0.9508759273    0.9980308 -0.994359598     1.981124
x2           0.9454677095    0.0000000  0.984872543     0.000000
x3           0.0005216332    0.0000000 -0.001093061     0.000000
(Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4          x2:1 
  0.024033064   0.025346616   0.009360320   0.028939527   0.040288328 
         x2:2          x3:1          x3:2 
  0.015073413   0.011186084   0.004185144 

Call:
vglm(formula = cbind(y1, y2) ~ x2 + x3, family = weibull.mean, 
    data = wdata, trace = TRUE)


Coefficients: 
                Estimate Std. Error  z value Pr(>|z|)    
(Intercept):1 -0.9508759  0.0240331  -39.565   <2e-16 ***
(Intercept):2  0.9980308  0.0253466   39.375   <2e-16 ***
(Intercept):3 -0.9943596  0.0093603 -106.231   <2e-16 ***
(Intercept):4  1.9811238  0.0289395   68.457   <2e-16 ***
x2:1           0.9454677  0.0402883   23.468   <2e-16 ***
x2:2           0.9848725  0.0150734   65.338   <2e-16 ***
x3:1           0.0005216  0.0111861    0.047    0.963    
x3:2          -0.0010931  0.0041851   -0.261    0.794    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Number of linear predictors:  4 

Names of linear predictors: 
loge(mean1), loge(shape1), loge(mean2), loge(shape2)

Log-likelihood: 901.6885 on 3992 degrees of freedom

Number of iterations: 8 

No Hauck-Donner effect found in any of the estimates

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.