The main function of this package is logConDens
: compute the maximum likelihood estimator (MLE) of a log-concave density from one-dimensional i.i.d. observations as well as the kernel smoothed version derived from it. A list of additional functions that can be used to compute quantities relevant in that context can be found below.
Two algorithms are offered to compute the estimate: An active set (logConDens
) and an iterative algorithm based on the pool-adjacent-violaters algorithm (icmaLogCon
). The latter of these functions is only part of this package for historical reasons: it was the first method that was proposed to estimate a log-concave density, see Rufibach (2007). The more efficient way of computing the estimate is via an active set algorithm. The smoothed versions of the log-concave density and distribution function estimates discussed in Section 3 of Duembgen and Rufibach (2009) are available in the function evaluateLogConDens
.
To compute a log-concave density, CDF, and survival function from interval- or right-censored observations use the package logconcens. A log-concave probability mass function can be computed using the package logcondiscr, see Balabdaoui et al (2012) for details. For the computation of a log-concave estimate in any dimension the package LogConDEAD can be used.
Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
Lutz Duembgen, duembgen@stat.unibe.ch,
https://www.imsv.unibe.ch/about_us/staff/prof_dr_duembgen_lutz/index_eng.html
Kaspar Rufibach gratefully acknowledges support by the Swiss National Science Foundation SNF, http://www.snf.ch.
MatLab code with an implementation of the active set algorithm is available on request from Lutz Duembgen.
Package: | logcondens |
Type: | Package |
Version: | 2.1.8 |
Date: | 2023-08-21 |
License: | GPL (>=2) |
The following additional functions and datasets are provided in the package:
evaluateLogConDens
Computes the value of the estimated log-density, density, and distribution function
of the MLE and the smoothed estimator at a given x0
.
quantilesLogConDens
Computes quantiles of the estimated distribution function at a given x0
.
intECDF
Compute the integrated empirical distribution function of the observations at a given x0
.
intF
Compute the integral of the distribution function corresponding to the log-concave density
estimator at a given x0
.
logconTwoSample
Compute a permutation test for the difference between two distribution functions.
logConROC
Compute ROC curve based on log-concave density estimates within cases and controls.
confIntBootLogConROC_t0
Compute bootstrap confidence intervals at given false positive fractions (= 1 - specificity) for the ROC curve based on log-concave density estimates.
logConCI
Compute a confidence interval for the value of the true density at a fixed point, based on the theory developed in Balabdaoui et al (2009). This function was contributed by Mahdis Azadbakhsh and Hanna Jankowski, see Azadbakhsh et al (2012).
isoMean
Compute the weighted least squares regression under a monotonicity constraint (the Grenander estimator).
This function is used as part of icmaLogCon
but is also of independent interest.
The following datasets have been used in several publications to illustrate log-concave density estimation and are therefore included in this package:
reliability
Dataset that contains the data analyzed in Duembgen and Rufibach (2009, Figure 2).
See the help file for logConDens
for the analysis of this data.
brightstar
Dataset that contains the data analyzed in Mizera and Koenker (2009, Section 5). The
sample consists of measurements of radial and rotational velocities for the stars from the Bright Star Catalog, see
Hoffleit and Warren (1991).
pancreas
Data from pancreatic cancer serum biomarker study, first published by Wieand et al (1989).
Contains data on serum measurements for a cancer antigen (CA-125) and
a carbohydrate antigen (CA19.9) both of which are measured on a continuous non-negative scale. The measurements were taken within a case-control
study on 90 cases with pancreatic cancer and 51 controls who did not have cancer but pancreatitis.
A print
and summary
for objects of class dlc
, generated by logConDens
, are available as well.
Azadbakhsh, M., Jankowski, H. and Gao, X. (2014). Computing confidence intervals for log-concave densities. Comput. Statist. Data Anal., 75, 248--264.
Balabdaoui, F., Jankowski, H., Rufibach, K. and Pavlides, M. (2012). Asymptotics of the discrete log-concave maximum likelihood estimator and related applications. J. R. Stat. Soc. Ser. B Stat. Methodol., 75(4), 769--790.
Baladbaoui, F., Rufibach, K. and Wellner, J. (2009). Limit distribution theory for maximum likelihood estimation of a log-concave density. Ann. Statist., 37(3), 1299--1331.
Duembgen, L., Huesler, A. and Rufibach, K. (2010). Active set and EM algorithms for log-concave densities based on complete and censored data. Technical report 61, IMSV, Univ. of Bern, available at https://arxiv.org/abs/0707.4643.
Duembgen, L. and Rufibach, K. (2009). Maximum likelihood estimation of a log--concave density and its distribution function: basic properties and uniform consistency. Bernoulli, 15(1), 40--68.
Duembgen, L. and Rufibach, K. (2011). logcondens: Computations Related to Univariate Log-Concave Density Estimation. Journal of Statistical Software, 39(6), 1--28. tools:::Rd_expr_doi("https://doi.org/10.18637/jss.v039.i06")
Hoffleit, D., Warren, W.H. (1991). The Bright Star Catalog. Yale University Observatory, New Heaven.
Mizera, I., Koenker, R. (2010). Quasi-concave density estimation. Ann. Statist., 38(5), 2998--3027.
Rufibach K. (2006).
Log-concave Density Estimation and Bump Hunting for i.i.d. Observations.
PhD Thesis, University of Bern, Switzerland and Georg-August University of Goettingen, Germany, 2006.
Available at https://slsp-ube.primo.exlibrisgroup.com/permalink/41SLSP_UBE/17e6d97/alma99116730175505511.
Rufibach, K. (2007). Computing maximum likelihood estimators of a log-concave density function. J. Stat. Comput. Simul. 77, 561--574.
Rufibach, K. (2012). A smooth ROC curve estimator based on log-concave density estimates. Int. J. Biostat., 8(1), 1--29.
## estimate gamma density
set.seed(1977)
x <- rgamma(100, 2, 1)
res <- logConDens(x, smoothed = FALSE, print = TRUE)
summary(res)
## compare performance to ICMA
res2 <- icmaLogCon(x, T1 = 2000, robustif = TRUE, print = TRUE)
res$L
res2$L
## plot resulting functions
par(mfrow = c(2, 2), mar = c(3, 2, 1, 2))
plot(res, which = "density")
plot(res, which = "log-density")
plot(res, which = "CDF")
xli <- range(res$x) + 0.1 * c(-1, 1) * diff(range(res$x))
plot(res$x, res$H, type = 'l', xlim = xli, yli = c(min(res$H) * 1.1, 0))
segments(res$knots, 0, res$knots, min(res$H) * 1.1, lty = 2)
rug(res$x); abline(h = 0, lty = 2)
## compute function values at an arbitrary point
x0 <- (res$x[50] + res$x[51]) / 2
evaluateLogConDens(x0, res)
## compute 0.5 quantile of Fhat
quantilesLogConDens(0.5, res)
Run the code above in your browser using DataLab