Density, distribution function, quantile function and random generation for the log-gamma distribution with location parameter location, scale parameter scale and shape parameter k.

dlgamma(x, location = 0, scale = 1, shape = 1, log = FALSE)
plgamma(q, location = 0, scale = 1, shape = 1,
        lower.tail = TRUE, log.p = FALSE)
qlgamma(p, location = 0, scale = 1, shape = 1,
        lower.tail = TRUE, log.p = FALSE)
rlgamma(n, location = 0, scale = 1, shape = 1)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. Same as runif.

location

the location parameter \(a\).

scale

the (positive) scale parameter \(b\).

shape

the (positive) shape parameter \(k\).

log

Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in pnorm or qnorm.

Value

dlgamma gives the density, plgamma gives the distribution function, qlgamma gives the quantile function, and rlgamma generates random deviates.

References

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

Author

T. W. Yee and Kai Huang

Details

See lgamma1, the VGAM family function for estimating the one parameter standard log-gamma distribution by maximum likelihood estimation, for formulae and other details. Apart from n, all the above arguments may be vectors and are recyled to the appropriate length if necessary.

Note

The VGAM family function lgamma3 is for the three parameter (nonstandard) log-gamma distribution.

See also

Examples

if (FALSE)  loc <- 1; Scale <- 1.5; shape <- 1.4
x <- seq(-3.2, 5, by = 0.01)
plot(x, dlgamma(x, loc = loc, Scale, shape = shape), type = "l",
     col = "blue", ylim = 0:1,
     main = "Blue is density, orange is the CDF",
     sub = "Red are 5,10,...,95 percentiles", las = 1, ylab = "")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'y' in selecting a method for function 'plot': object 'loc' not found
abline(h = 0, col = "blue", lty = 2)
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet
lines(qlgamma(seq(0.05, 0.95, by = 0.05), loc = loc, Scale, sh = shape),
      dlgamma(qlgamma(seq(0.05, 0.95, by = 0.05), loc = loc, sc = Scale,
                      shape = shape),
    loc = loc, Scale, shape = shape), col = "red", lty = 3, type = "h")
#> Error: object 'loc' not found
lines(x, plgamma(x, loc = loc, Scale, shape = shape), col = "orange")
#> Error: object 'loc' not found
abline(h = 0, lty = 2)  # \dontrun{}
#> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...): plot.new has not been called yet