
Last chance! 50% off unlimited learning
Sale ends in
logConDens
: A function to 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 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.
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.## 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")
plot(res$x, res$H, type = 'l'); rug(res$x)
## 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