Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

otlogUC

One-truncated Logarithmic Distribution


Description

Density, distribution function, quantile function, and random generation for the one-truncated logarithmic distribution.

Usage

dotlog(x, shape, log = FALSE)
potlog(q, shape, log.p = FALSE)
qotlog(p, shape)
rotlog(n, shape)

Arguments

x, q

Vector of quantiles. For the density, it should be a vector with integer values > 1 in order for the probabilities to be positive.

p

vector of probabilities.

n

number of observations. Same as in runif.

shape

The parameter value c described in in logff. Here it is called shape because 0<c<1 is the range.

log, log.p

Logical. If log.p = TRUE then all probabilities p are given as log(p).

Details

The one-truncated logarithmic distribution is a logarithmic distribution but with the probability of a one being zero. The other probabilities are scaled to add to unity. Some more details are given in logff.

Value

dotlog gives the density, potlog gives the distribution function, qotlog gives the quantile function, and rotlog generates random deviates.

Note

Given some response data, the VGAM family function otlog estimates the parameter shape. Function potlog() suffers from the problems that plog sometimes has.

Author(s)

T. W. Yee

See Also

Examples

dotlog(1:20, 0.5)
rotlog(20, 0.5)

## Not run:  shape <- 0.8; x <- 1:10
plot(x, dotlog(x, shape = shape), type = "h", ylim = 0:1,
     sub = "shape=0.8", las = 1, col = "blue", ylab = "Probability",
     main = "1-truncated logarithmic distribution: blue=PMF; orange=CDF")
lines(x + 0.1, potlog(x, shape = shape), col = "orange", lty = 3, type = "h") 
## End(Not run)

VGAMdata

Data Supporting the 'VGAM' Package

v1.1-5
GPL-2
Authors
Thomas Yee [aut, cre, cph], James Gray [dtc]
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.