logcon-package {logcondens}R Documentation

Estimate a Log-Concave Probability Density from i.i.d. Observations

Description

Given a vector of observations x = (x_1, ..., x_m) with pairwise distinct entries and a vector of weights w=(w_1, ..., w_m) s.t. sum_{i=1}^m w_i = 1, this package allows to compute a concave, piecewise linear function widehat varphi_m on [x_1, x_m] with knots only in {x_1, ..., x_m} such that

L(varphi) = sum_{i=1}^m w_i varphi(x_i) - int_{-infty}^infty exp(varphi(t)) dt

is maximal. According to the results in Duembgen and Rufibach (2006), this function widehat varphi_m maximizes the ordinary log-likelihood

sum_{i=1}^m w_i varphi(x_i)

under the constraint that varphi is concave. The corresponding function widehat f_m := exp(widehatvarphi_m) is a log-concave probability density. Two algorithms are offered: An active set algorithm and one based on the pool-adjacent-violaters algorithm.

Details

Package: logcondens
Type: Package
Version: 1.0
Date: 2006-09-28
License: GPL version 2 or newer

Use this package to estimate a log-concave density from i.i.d. observations. The package offers two algorithms which are implemented in the functions icmaLogCon and activeSetLogCon. Additionally, the value of the log-density, the density and the distribution function can be computed using evaluateLogConDens. To compute quantiles of the estimated distribution function use quantilesLogConDens.

Author(s)

Kaspar Rufibach (maintainer), kaspar.rufibach@stanford.edu,
http://www.stanford.edu/~kasparr

Lutz Duembgen, duembgen@stat.unibe.ch,
http://www.stat.unibe.ch/~duembgen

References

Duembgen, L. and Rufibach, K. (2006) Maximum likelihood estimation of a log–concave density and its distribution function: basic properties and uniform consistency. Preprint, IMSV, University of Bern.

Duembgen, L, Huesler, A. and Rufibach, K. (2006) Active set and EM algorithms for log-concave densities based on complete and censored data. Preprint, IMSV, University of Bern.

Rufibach, K. (2006a) Computing maximum likelihood estimators of a log-concave density function. To appear in Journal of Statistical Computation and Simulation.

Rufibach K. (2006b) 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.

Examples

## estimate gamma density
set.seed(1977)
x <- sort(rgamma(200, 2, 1))
res <- activeSetLogCon(x, w = NA, print = FALSE)

## plot resulting functions
par(mfrow = c(2, 2), mar = c(3, 2, 1, 2))
plot(x, exp(res$phi), type = 'l'); rug(x)
plot(x, res$phi, type = 'l'); rug(x)
plot(x, res$F, type = 'l'); rug(x)
plot(x, res$H, type = 'l'); rug(x)

## compute function values at an arbitrary point
x0 <- (x[100] + x[101]) / 2
evaluateLogConDens(x0, x, exp(res$phi), res$F, res$IsKnot)

## compute 0.5 quantile of estimated F
quantilesLogConDens(0.5, x, exp(res$phi), res$F, res$IsKnot)

[Package logcondens version 1.0 Index]