# icmaLogCon: Computes a Log-Concave Probability Density Estimate via an... In logcondens: Estimate a Log-Concave Probability Density from Iid Observations

## Description

Given a vector of observations x_n = (x_1, …, x_n) with not necessarily equal entries, activeSetLogCon first computes vectors x_m = (x_1, …, x_m) and w = (w_1, …, w_m) where w_i is the weight of each x_i s.t. ∑_{i=1}^m w_i = 1. Then, activeSetLogCon computes a concave, piecewise linear function \widehat φ_m on [x_1, x_m] with knots only in {x_1, …, x_m} such that

L(φ) = ∑_{i=1}^m w_i φ(x_i) - \int_{-∞}^∞ exp(φ(t)) dt

is maximal. In order to be able to apply the pool - adjacent - violaters algorithm, computations are performed in the parametrization

η(φ) = (φ_1, (η_1 + ∑_{j=2}^i (x_i-x_{i-1})η_i)_{i=2}^m ).

To find the maximum of L, a variant of the iterative convex minorant using the pool - adjacent - violaters algorithm is used.

## Usage

 1 2 icmaLogCon(x, xgrid = NULL, eps = 10^-8, T1 = 2000, robustif = TRUE, print = FALSE) 

## Arguments

 x Vector of independent and identically distributed numbers, not necessarily equal. xgrid Governs the generation of weights for observations. See preProcess for details. eps An arbitrary real number, typically small. Iterations are halted if the directional derivative of {\bold{η}} \to L({\bold{η}}) in the direction of the new candidate is ≤ \varepsilon. T1 Maximal number of iterations to perform. robustif robustif = TRUE performs the robustification and Hermite interpolation procedure detailed in Rufibach (2006, 2007), robustif = FALSE does not. In the latter case, convergence of the algorithm is no longer guaranteed. print print = TRUE outputs log-likelihood in every loop, print = FALSE does not. Make sure to tell R to output (press CTRL+W).

## Value

 x Vector of observations x_1, …, x_m that was used to estimate the density. w The vector of weights that had been used. Depends on the chosen setting for xgrid. f Vector with entries \widehat f_m(x_i). xn Vector with initial observations x_1, …, x_n. Loglik The value L(\widehat φ_m) of the log-likelihood-function L at the maximum \widehat φ_m. Iterations Number of iterations performed. sig The standard deviation of the initial sample x_1, …, x_n.

## Author(s)

Kaspar Rufibach, kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch

## References

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.

Rufibach, K. (2007) Computing maximum likelihood estimators of a log-concave density function. J. Stat. Comput. Simul. 77, 561–574.

icmaLogCon can be used to estimate a log-concave density. However, to generate an object of class dlc that allows application of summary and plot one has to use logConDens.

The following functions are used by icmaLogCon:

phieta, etaphi, Lhat_eta, quadDeriv, robust, isoMean.

## Examples

  1 2 3 4 5 6 7 8 9 10 11 set.seed(1977) x <- rgamma(200, 2, 1) ## Not run: res <- icmaLogCon(x, T1 = 2000, robustif = TRUE, print = TRUE) ## plot resulting functions par(mfrow = c(2, 1), mar = c(3, 2, 1, 2)) plot(x, exp(res$phi), type = 'l'); rug(x) plot(x, res$phi, type = 'l'); rug(x) ## End(Not run) 

logcondens documentation built on May 2, 2019, 6:11 a.m.