Learn R Programming

VGAM (version 0.8-1)

lgammaff: Log-gamma Distribution Family Function

Description

Estimation of the parameter of the standard and nonstandard log-gamma distribution.

Usage

lgammaff(link = "loge", earg = list(), init.k = NULL)
lgamma3ff(llocation = "identity", lscale = "loge", lshape = "loge",
          elocation = list(), escale = list(), eshape = list(),
          ilocation = NULL, iscale = NULL, ishape = 1, zero = NULL)

Arguments

llocation, lscale
Parameter link function applied to the location parameter $a$ and the positive scale parameter $b$. See Links for more choices.
link, lshape
Parameter link function applied to the positive shape parameter $k$. See Links for more choices.
earg, elocation, escale, eshape
List. Extra argument for each of the links. See earg in Links for general information.
init.k, ishape
Initial value for $k$. If given, it must be positive. If failure to converge occurs, try some other value. The default means an initial value is determined internally.
ilocation, iscale
Initial value for $a$ and $b$. The defaults mean an initial value is determined internally for each.
zero
An integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The values must be from the set {1,2,3}. The default value means none are modelled as intercept-only terms. See

Value

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

Details

The probability density function of the standard log-gamma distribution is given by $$f(y)=\exp[ky - \exp(y)] / \Gamma(k),$$ for parameter $k>0$ and all real $y$. The mean of $Y$ is digamma(k) (returned as the fitted values) and its variance is trigamma(k).

For the non-standard log-gamma distribution, one replaces $y$ by $(y-a)/b$, where $a$ is the location parameter and $b$ is the positive scale parameter. Then the density function is $$f(y)=\exp[k(y-a)/b - \exp((y-a)/b)] / (b \, \Gamma(k)).$$ The mean and variance of $Y$ are a + b*digamma(k) (returned as the fitted values) and b^2 * trigamma(k), respectively.

References

Kotz, S. and Nadarajah, S. (2000) Extreme Value Distributions: Theory and Applications, pages 48--49, London: Imperial College Press.

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

See Also

rlgamma, gengamma, prentice74, gamma1, lgamma.

Examples

Run this code
ldat = data.frame(y = rlgamma(100, k = exp(1)))
fit = vglm(y ~ 1, lgammaff, ldat, trace = TRUE, crit = "coef")
summary(fit)
coef(fit, matrix = TRUE)
Coef(fit)

ldat = data.frame(x = runif(nn <- 5000))     # Another example
ldat = transform(ldat, loc = -1 + 2*x, Scale = exp(1))
ldat = transform(ldat, y = rlgamma(nn, loc, scale = Scale, k = exp(0)))
fit = vglm(y ~ x, lgamma3ff(zero = 2:3), ldat, trace = TRUE, crit = "c")
coef(fit, matrix = TRUE)

Run the code above in your browser using DataLab