logUC.RdDensity, distribution function, quantile function, and random generation for the logarithmic distribution.
dlog(x, shape, log = FALSE)
plog(q, shape, lower.tail = TRUE, log.p = FALSE)
qlog(p, shape)
rlog(n, shape)The details are given in logff.
dlog gives the density,
plog gives the distribution function,
qlog gives the quantile function, and
rlog generates random deviates.
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
Given some response data, the VGAM family function
logff estimates the parameter shape.
For plog(), if argument q contains large values
and/or q is long in length
then the memory requirements may be very high.
Very large values in q are handled by an approximation by
Owen (1965).
dlog(1:20, 0.5)
#> [1] 7.213475e-01 1.803369e-01 6.011229e-02 2.254211e-02 9.016844e-03
#> [6] 3.757018e-03 1.610151e-03 7.044409e-04 3.130849e-04 1.408882e-04
#> [11] 6.404009e-05 2.935171e-05 1.354694e-05 6.289651e-06 2.935171e-06
#> [16] 1.375861e-06 6.474641e-07 3.057469e-07 1.448275e-07 6.879306e-08
rlog(20, 0.5)
#> [1] 1 1 1 1 1 1 1 2 2 1 1 1 1 1 3 1 1 1 1 2
if (FALSE) shape <- 0.8; x <- 1:10
plot(x, dlog(x, shape = shape), type = "h", ylim = 0:1,
sub = "shape=0.8", las = 1, col = "blue", ylab = "shape",
main = "Logarithmic distribution: blue=PDF; orange=CDF")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'y' in selecting a method for function 'plot': object 'shape' not found
lines(x + 0.1, plog(x, shape), col = "orange", lty = 3, type = "h") # \dontrun{}
#> Error: object 'shape' not found