Description Usage Arguments Details Value Note Author(s) References See Also Examples
Uses Shor's ralgorithm to compute the maximum
likelihood estimator of a logconcave density based on an
i.i.d. sample. The estimator is uniquely determined by its value at the data
points. The output is an object of class "LogConcDEAD"
which
contains all the information needed to plot the estimator using the
plot
method, or to evaluate it using
the function dlcd
.
1 2 3 4 
x 
Data in R^d, in the form of an n x d numeric 
w 
Vector of weights w_i such that the computed estimator maximizes w[1] log f(x[1,]) + ... + w[n] log f([x,n]) 
subject to the restriction that f is logconcave. The default is 1/n for all i, which corresponds to i.i.d. observations.
y 
Vector giving starting point for the ralgorithm. If none given, a kernel estimate is used. 
verbose 

alpha 
Scalar parameter for SolvOpt 
c 
Scalar giving starting step size 
sigmatol 
Realvalued scalar giving one of the stopping
criteria: Relative change in sigma must be below

ytol 
Realvalued scalar giving on of the stopping criteria: Relative change in y must be
below 
integraltol 
Realvalued scalar giving one of the stopping
criteria: exp(h_y)  1 must be below

Jtol 
Parameter controlling when Taylor expansion is used in computing the function sigma 
chtol 
Parameter controlling convex hull computations 
The logconcave maximum likelihood density estimator based on data X_1, ..., X_n is the function that maximizes
(w_1 log f(X_1) + ... + w_n log f(X_n))
subject to the constraint that f is logconcave. For i.i.d.~data, the weights w_i should be 1/n for each i.
This is a function of the form h_y for some y in R^n, where
h_y(x) = inf{h(x): h concave, h(x_i) >= y_i for i = 1, ..., n}.
Functions of this form may equivalently be specified by dividing C_n, the convex hull of the data, into simplices C_j for j \in J (triangles in 2d, tetrahedra in 3d etc), and setting
f(x) = exp{b_j^T x  beta_j}
for x in C_j, and f(x) = 0 for x not in C_n.
This function uses Shor's ralgorithm (an iterative subgradientbased procedure) to minimize over vectors y in R^n the function
sigma(y) = 1/n (y_1 + ... + y_n) + int (h_y(x)) dx.
This is equivalent to finding the logconcave maximum likelihood estimator, as demonstrated in Cule, Samworth and Stewart (2008).
An implementation of Shor's ralgorithm based on SolvOpt is used.
Computing sigma makes use of the qhull library. Code from this Cbased library is copied here as it is not currently possible to use compiled code from another library. For points not in general position, this requires a Taylor expansion of sigma, discussed in Cule and D\"umbgen (2008).
An object of class "LogConcDEAD"
, with the following
components:
x 
Data copied from input (may be reordered) 
w 
weights copied from input (may be reordered) 
logMLE 

NumberOfEvaluations 
Vector containing the number of steps, number of function evaluations, and number of subgradient evaluations. If the SolvOpt algorithm fails, the first component will be an error code (<0). 
MinSigma 
Realvalued scalar giving minimum value of the objective function 
b 

beta 

triang 

verts 

vertsoffset 

chull 
Vector containing vertices of faces of the convex hull of the data 
outnorm 

outoffset 

For onedimensional data, the active set algorithm of
logcondens
is faster, and may be
preferred.
The authors gratefully acknowledge the assistance of Lutz Duembgen at the University of Bern for his insight into the objective function sigma.
Further references, including definitions and background material, may be found in Cule, Samworth and Stewart (2008).
Madeleine Cule
Robert B. Gramacy
Richard Samworth
Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T. (1996) The Quickhull algorithm for convex hulls ACM Trans. on Mathematical Software, 22(4) p.469483 http://www.qhull.org
Cule, M. L. and D\"umbgen, L. (2008) On an auxiliary function for logdensity estimation, University of Bern technical report. http://arxiv.org/abs/0807.4719
Cule, M. L., Samworth, R. J., and Stewart, M. I. (2010) Maximum likelihood estimation of a logconcave density, Journal of the Royal Statistical Society, Series B, 72(5) p.545607.
Kappel, F. and Kuntsevich, A. V. (2000) An implementation of Shor's ralgorithm, Computational Optimization and Applications, Volume 15, Issue 2, 193205.
Shor, N. Z. (1985) Minimization methods for nondifferentiable functions, SpringerVerlag
logcondens
,
interplcd
, plot.LogConcDEAD
,
interpmarglcd
, rlcd
, dlcd
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51  ## Some simple normal data, and a few plots
x < matrix(rnorm(200),ncol=2)
lcd < mlelcd(x)
g < interplcd(lcd)
par(mfrow=c(2,2), ask=TRUE)
plot(lcd, g=g, type="c")
plot(lcd, g=g, type="c", uselog=TRUE)
plot(lcd, g=g, type="i")
plot(lcd, g=g, type="i", uselog=TRUE)
## Some plots of marginal estimates
par(mfrow=c(1,1))
g.marg1 < interpmarglcd(lcd, marg=1)
g.marg2 < interpmarglcd(lcd, marg=2)
plot(lcd, marg=1, g.marg=g.marg1)
plot(lcd, marg=2, g.marg=g.marg2)
## generate some points from the fitted density
## via independent rejection sampling
generated1 < rlcd(100, lcd)
colMeans(generated1)
## via MetropolisHastings algorithm
generated2 < rlcd(100, lcd, "MH")
colMeans(generated2)
## evaluate the fitted density
mypoint < c(0, 0)
dlcd(mypoint, lcd, uselog=FALSE)
mypoint < c(1, 0)
dlcd(mypoint, lcd, uselog=FALSE)
## evaluate the marginal density
dmarglcd(0, lcd, marg=1)
dmarglcd(1, lcd, marg=2)
## evaluate the covariance matrix of the fitted density
covariance < cov.LogConcDEAD(lcd)
## find the hat matrix for the smoothed logconcave that
## matches empirical mean and covariance
A < hatA(lcd)
## evaluate the fitted smoothed logconcave density
mypoint < c(0, 0)
dslcd(mypoint, lcd, A)
mypoint < c(1, 0)
dslcd(mypoint, lcd, A)
## generate some points from the fitted smoothed logconcave density
generated < rslcd(100, lcd, A)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.