
Density, distribution function, quantile function, and random generation for the one-truncated logarithmic distribution.
dotlog(x, shape, log = FALSE)
potlog(q, shape, log.p = FALSE)
qotlog(p, shape)
rotlog(n, shape)
Vector of quantiles. For the density, it should be a vector with
integer values
vector of probabilities.
number of observations.
Same as in runif
.
The parameter value logff
.
Here it is called shape
because
Logical.
If log.p = TRUE
then all probabilities p
are
given as log(p)
.
dotlog
gives the density,
potlog
gives the distribution function,
qotlog
gives the quantile function, and
rotlog
generates random deviates.
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
.
# NOT RUN {
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")
# }
Run the code above in your browser using DataLab