quantilesLogConDens {logcondens}R Documentation

Function to compute Quantiles of Fhat

Description

Function to compute p0p_0-quantile of

F^m(t)=x1tf^m(t)dt,\widehat F_m(t) = \int_{x_1}^t \widehat f_m(t) dt,

where f^m\widehat f_m is the log-concave density estimator, typically computed via logConDens and p0p_0 runs through the vector ps. The formula to compute a quantile at u[F^m(xj),F^m(xj+1)]u \in [\widehat F_m(x_j), \widehat F_m(x_{j+1})] for j=1,,n1j = 1, \ldots, n-1 is:

F^m1(u)=xj+(xj+1xj)G(xj+1xj)(ϕ^j+1ϕ^j)1(uF^m(xj)F^m(xj+1)F^m(xj)),\widehat F_m^{-1}(u) = x_j + (x_{j+1}-x_j) G^{-1}_{(x_{j+1}-x_j)(\widehat \phi_{j+1}-\widehat \phi_j)} \Big( \frac{u - \widehat F_m(x_j)}{ \widehat F_m(x_{j+1}) - \widehat F_m(x_j)}\Big),

where Gθ1G^{-1}_\theta is described in qloglin.

Usage

quantilesLogConDens(ps, res)

Arguments

ps

Vector of real numbers where quantiles should be computed.

res

An object of class "dlc", usually a result of a call to logConDens.

Value

Returns a data.frame with row (p0,i,q0,i)(p_{0, i}, q_{0, i}) where q0,i=infx{F^m(x)p0,i}q_{0, i} = \inf_{x}\{\widehat F_m(x) \ge p_{0, i}\} and p0,ip_{0, i} runs through ps.

Author(s)

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

Lutz Duembgen, duembgen@stat.unibe.ch,
https://www.imsv.unibe.ch/about_us/staff/prof_dr_duembgen_lutz/index_eng.html

Examples

## estimate gamma density
set.seed(1977)
x <- rgamma(200, 2, 1)
res <- logConDens(x, smoothed = FALSE, print = FALSE)

## compute 0.95 quantile of Fhat
q <- quantilesLogConDens(0.95, res)[, "quantile"]
plot(res, which = "CDF", legend.pos = "none")
abline(h = 0.95, lty = 3); abline(v = q, lty = 3)

[Package logcondens version 2.1.8 Index]