# intFfn: Computes the Integral of a log-concave CDF at Arbitrary Real... In logcondens.mode: Compute MLE of Log-Concave Density on R with Fixed Mode, and Perform Inference for the Mode.

## Description

Based on output from the function logConDens, activeSetLogCon, or activeSetLogCon.mode, this function gives a function \widehat I given by

\hat I(l,r) = \int_{l}^{r} \hat{F}(u) du

or by

\hat I(l,r) = \int_{l}^{r} (1-\hat{F}(u)) du

Note that l and r must lie in [x_1,x_m]. For exact formulas related to these integrals, see the intF function.

## Usage

 1 intFfn(x, phi, Fhat, prec = 1e-10, side = "left") 

## Arguments

 x Vector of (unique) observations from which the (modally-constrained or -unconstrained) log-concave density is estimated. This corresponds to output of preProcess, potentially with a constrained mode value inserted. Weights associated with x are not passed in since we pass in the estimated values phi and Fhat. phi Numeric vector of same length as x that gives the log-concave estimate's values at x. Fhat Numeric vector of same length as x that gives the log-concave estimate CDF's values at x. prec Precision argument for the intF function. side String taking values "left" or "right". If "left" then returns the first integral given in the description (integral of \widehat{F}). If "right" then returns the second integral given in the description (integral of 1-\widehat{F}).

## Value

Returns a function H. If side is "left" then the return is of type

 1  function(upper, lower=rep(x,length(upper))). 

If side is "right" then the return is of type

 1  function(lower, upper=rep(x[length(x)],length(lower))). 

Note that the order of the arguments are changed, so that passing an unnamed numeric value or vector has a default behavior of integrating "from the outside-in".

## Author(s)

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

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

## References

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 http://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. http://www.jstatsoft.org/v39/i06

Doss, C. R. (2013). Shape-Constrained Inference for Concave-Transformed Densities and their Modes. PhD thesis, Department of Statistics, University of Washington, in preparation.

Doss, C. R. and Wellner, J. A. (2013). Inference for the mode of a log-concave density. Technical Report, University of Washington, in preparation.

This function uses the output of activeSetLogCon or activeSetLogCon.mode. The function intECDFfn is similar, but based on the empirical distribution function. The function intF behaves similarly but returns a vector instead of a function.
  1 2 3 4 5 6 7 8 9 10 11 ## estimate gamma density set.seed(1977) x <- rgamma(200, 2, 1) res <- activeSetLogCon.mode(x, mode=1) ## res$x is not equal to x myIntF <- intFfn( res$x, res$phi, res$Fhat, side="left") s <- seq(min(res$x), max(res$x), by = 10 ^ -3) D1 <- myIntF(s)