Learn R Programming

VGAMextra (version 0.0-6)

invweibull2mr: 2- parameter Inverse Weibull Distribution

Description

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

Usage

invweibull2mr(lscale  = loglink, 
                lshape  = logofflink(offset = -2),
                iscale  = NULL, 
                ishape  = NULL, 
                imethod = 2, 
                lss     = TRUE, 
                gscale  = exp(-4:4), 
                gshape  = exp(-4:4),
                probs.y = c(0.25, 0.50, 0.75),
                zero    = "shape")

Value

An object of class "vglmff"

(see vglmff-class). The object is used to model special models such as

vglm and vgam.

Arguments

lscale, lshape

Parameter link functions applied to the (positive) shape parameter (called \(a\) below) and (positive) scale parameter (called \(b\) below). Given that the shape parameter must be greater than \(2\), lshape = logofflink(offset = -2) by default. See Links for more choices.

iscale, ishape

Optional initial values for the shape and scale parameters.

gscale, gshape

See CommonVGAMffArguments.

lss, probs.y

Details at CommonVGAMffArguments.

imethod

Initializing method internally implemented. Currently only the values 1 and 2 are allowed and NO observations should be censored.

zero

Numeric or character vector. The position(s) of the name(s) of the parameters/linear predictors to be modeled as intercept--only. Default is "shape". Details at CommonVGAMffArguments

Author

Victor Miranda and T. W. Yee.

Warning

Note that zero can be a numeric or a character vector specifying the position of the names (partially or not) of the linear predictor modeled as intercept only. In this family function these names are

c("scale", "shape").

Numeric values can be entered as usual. See CommonVGAMffArguments for further details. For simplicity, the second choice is recommended.

If the shape parameter is less than two (i.e. less than exp(0.69315)), then misleading inference may result ! (see above the regularity condition for the 'variance'), e.g., in the summary and vcov of the object.

However, the larger the shape parameter is (for instance, greater than exp(2.5), plus reasonable scale), the more unstable the algorithm may become. The reason is that inverse weibull densities under such conditions are highly peaked and left skewed. Thus, density values are too close to zero (or values represented as zero in computer arithmetic).

Details

The Weibull distribution and the Inverse Weibull distributions are related as follows:

Let \(X\) be a Weibull random variable with paramaters scale =\(b\) and shape =\(a\). Then, the random variable \(Y = 1/X\) has the Inverse Weibull density with parameters scale = \(1/b\) and shape = \(a\).

The Inverse weibull density for a response \(Y\) is given by $$f(y;a,b) = a (b^a) y^{-a-1} \exp[-(y/b)^(-a)] $$ for \(a > 0\), \(b > 0\), \(y > 0\). The mean, that is returned as the fitted values, (if \(a > 1\)) and the variance (if \(a > 2\)) are $$E[Y] = b \ \Gamma(1 - 1/a); \ \ \ Var[Y] = b^{2} \ [\Gamma(1 - 2/a) - (\Gamma(1 - 1/a))^2].$$

Fisher scoring is used to estimate both parameters. Although the expected information matrices used are valid in all regions of the parameter space, the regularity conditions for maximum likelihood estimation (MLE) are satisfied only if \(a>2\) (according to Kleiber and Kotz (2003)). If this is violated then a warning message is issued. To enforce \(a > 2\), it has been set by default that lshape = logofflink(offset = 2).

As a result of the math relation between the Weibull and the Inverse Weibull distributions, regularity conditions for inference for the latter, are the following: if \(a \le 1\) then the MLE's are not consisten, if \(1 < a < 2\) then MLEs exist but are not assymptotically normal, if \(a = 2\), the MLE's exist and are normal and asymptotically efficient but the convergence rate is slower compared when \(a > 2\). If \(a > 2\), then the MLE's have classical asymptotic properties.

References

Harper, W. V., 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.

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.

See Also

invweibullDist, weibullR.

Examples

Run this code
#-----------------------------------------------------------------------#
# Here, covariate 'x2' affects the scale parameter.
# See how data is generated.

set.seed(102)
wdata <- data.frame(x2 = runif(nn <- 1000))  # Complete data
wdata <- transform(wdata,
            y1 = rinvweibull(nn, scale = exp(2.5 - (0.5) * x2), 
                             shape = exp(1.5) ),
                             
            y2 = rinvweibull(nn, scale = exp(1.5 + x2), 
                             shape = exp(1.25) ))
            
#------------------------------------------------------------------------#
# Fitting the Inverse Weibull distribution accordingly.
# Note that multiple responses are handled. 

fit1 <- vglm(cbind(y1, y2) ~ x2, 
             invweibull2mr(zero = "shape",
                           # OPTIONAL INITIAL VALUE. Be carefull here when
                           # entered initial value. Sensitive distribution
                             ishape = exp(1.2),
                          lss = TRUE),                           
             data = wdata, trace = TRUE, crit = "log")

coef(fit1, matrix = TRUE)
vcov(fit1)
summary(fit1)

###   A second option (producing same results!!) might be to use the 
###   constraints argument in the 'vglm()' call. Note that 'x2' affects
###   the scale parameter only.

fit2 <- vglm(y1 ~ x2, 
             invweibull2mr(zero = NULL), 
             data = wdata, trace = TRUE,
             constraints = list(x2 = rbind(1, 0)))
            
coef(fit2, matrix = TRUE)
vcov(fit2)
summary(fit2)
constraints(fit2)



Run the code above in your browser using DataLab