gompertz: Gompertz Regression Family Function

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

View source: R/family.actuary.R

Description

Maximum likelihood estimation of the 2-parameter Gompertz distribution.

Usage

1
2
3
gompertz(lscale = "loglink", lshape = "loglink",
         iscale = NULL,   ishape = NULL,
         nsimEIM = 500, zero = NULL, nowarning = FALSE)

Arguments

nowarning

Logical. Suppress a warning? Ignored for VGAM 0.9-7 and higher.

lshape, lscale

Parameter link functions applied to the shape parameter a, scale parameter scale. All parameters are positive. See Links for more choices.

ishape, iscale

Optional initial values. A NULL means a value is computed internally.

nsimEIM, zero

See CommonVGAMffArguments.

Details

The Gompertz distribution has a cumulative distribution function

F(x;alpha, beta) = 1 - exp(-(alpha/beta) * (exp(beta * x) - 1) )

which leads to a probability density function

f(x; alpha, beta) = alpha * exp[-beta * x] * exp[-(alpha/beta) * (exp(beta * x) - 1) ]

for a > 0, b > 0, x > 0. Here, β is called the scale parameter scale, and α is called the shape parameter (one could refer to a as a location parameter and b as a shape parameter—see Lenart (2012)). The mean is involves an exponential integral function. Simulated Fisher scoring is used and multiple responses are handled.

The Makeham distibution has an additional parameter compared to the Gompertz distribution. If X is defined to be the result of sampling from a Gumbel distribution until a negative value Z is produced, then X = -Z has a Gompertz distribution.

Value

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

Warning

The same warnings in makeham apply here too.

Author(s)

T. W. Yee

References

Lenart, A. (2012). The moments of the Gompertz distribution and maximum likelihood estimation of its parameters. Scandinavian Actuarial Journal, in press.

See Also

dgompertz, makeham, simulate.vlm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
gdata <- data.frame(x2 = runif(nn <- 1000))
gdata <- transform(gdata, eta1  = -1,
                          eta2  = -1 + 0.2 * x2,
                          ceta1 =  1,
                          ceta2 = -1 + 0.2 * x2)
gdata <- transform(gdata, shape1 = exp(eta1),
                          shape2 = exp(eta2),
                          scale1 = exp(ceta1),
                          scale2 = exp(ceta2))
gdata <- transform(gdata, y1 = rgompertz(nn, scale = scale1, shape = shape1),
                          y2 = rgompertz(nn, scale = scale2, shape = shape2))

fit1 <- vglm(y1 ~ 1,  gompertz, data = gdata, trace = TRUE)
fit2 <- vglm(y2 ~ x2, gompertz, data = gdata, trace = TRUE)
coef(fit1, matrix = TRUE)
Coef(fit1)
summary(fit1)
coef(fit2, matrix = TRUE)
summary(fit2)

## End(Not run)

Example output

Loading required package: stats4
Loading required package: splines
VGLM    linear loop  1 :  loglikelihood = -228.41701
VGLM    linear loop  2 :  loglikelihood = -227.64391
VGLM    linear loop  3 :  loglikelihood = -227.64213
VGLM    linear loop  4 :  loglikelihood = -227.64213
VGLM    linear loop  1 :  loglikelihood = -1293.0365
VGLM    linear loop  2 :  loglikelihood = -1290.0635
VGLM    linear loop  3 :  loglikelihood = -1289.9114
VGLM    linear loop  4 :  loglikelihood = -1289.9105
VGLM    linear loop  5 :  loglikelihood = -1289.9105
VGLM    linear loop  6 :  loglikelihood = -1289.9105
            loge(scale) loge(shape)
(Intercept)    1.012078   -1.064231
    scale     shape 
2.7513114 0.3449929 

Call:
vglm(formula = y1 ~ 1, family = gompertz, data = gdata, trace = TRUE)


Pearson residuals:
                Min      1Q  Median     3Q   Max
loge(scale) -10.968 -0.1549  0.2934 0.5350 0.616
loge(shape)  -1.325 -0.8906 -0.1406 0.7675 2.175

Coefficients: 
              Estimate Std. Error z value Pr(>|z|)    
(Intercept):1  1.01208    0.03624   27.93   <2e-16 ***
(Intercept):2 -1.06423    0.07375  -14.43   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Number of linear predictors:  2 

Names of linear predictors: loge(scale), loge(shape)

Log-likelihood: -227.6421 on 1998 degrees of freedom

Number of iterations: 4 
            loge(scale) loge(shape)
(Intercept) -0.82934894  -1.0713993
x2          -0.09195182   0.3595059

Call:
vglm(formula = y2 ~ x2, family = gompertz, data = gdata, trace = TRUE)


Pearson residuals:
                Min      1Q Median     3Q    Max
loge(scale) -10.542 -0.3881 0.2011 0.6227 0.9884
loge(shape)  -2.525 -0.7816 0.1353 0.8732 1.5797

Coefficients: 
              Estimate Std. Error z value Pr(>|z|)    
(Intercept):1 -0.82935    0.13756  -6.029 1.65e-09 ***
(Intercept):2 -1.07140    0.10850  -9.874  < 2e-16 ***
x2:1          -0.09195    0.25631  -0.359    0.720    
x2:2           0.35951    0.18809   1.911    0.056 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Number of linear predictors:  2 

Names of linear predictors: loge(scale), loge(shape)

Log-likelihood: -1289.91 on 1996 degrees of freedom

Number of iterations: 6 

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