Learn R Programming

cnmlcd (version 1.2-0)

log-concave: The Log-concave Distribution.

Description

Density and dstribution function for a log-concave distribution.

Usage

dlcd(x, lcd, log = FALSE)
plcd(q, lcd, lower.tail = TRUE, log.p = FALSE)

Arguments

x, q

vector of quantiles.

lcd

an object of class lcd.

log, log.p

logical. If TRUE, the log density or log probability values are to be returned.

lower.tail

logical. If TRUE (default), probabilities are p[X <= q]; if otherwise, p[X > q].

Value

dlcd gives the density values, and plcd gives the distribution function values.

References

Liu, Y. and Wang, Y. (2018). A Fast Algorithm for Univariate Log-concave Density Estimation. Australia & New Zealand Journal of Statistics (To appear).

See Also

cnmlcd, lcd.

Examples

Run this code
# NOT RUN {
x = rnorm(1000)
r = cnmlcd(x)
dlcd(-4:4, r$lcd)
dlcd(-4:4, r$lcd, log=TRUE)
plcd(-4:4, r$lcd)
plcd(-4:4, r$lcd, lower.tail = FALSE)
# }

Run the code above in your browser using DataLab