Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

quantilesLogConDens

Function to compute Quantiles of Fhat


Description

Function to compute p_0-quantile of

\hat F_m(t) = \int_{x_1}^t \hat f_m(t) dt,

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

\hat F_m^{-1}(u) = x_j + (x_{j+1}-x_j) G^{-1}_{(x_{j+1}-x_j)(\hat φ_{j+1}-\hat φ_j)} ((u - \hat F_m(x_j))/(\hat F_m(x_{j+1}) - \hat F_m(x_j))),

where G^{-1}_θ 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 (p_{0, i}, q_{0, i}) where q_{0, i} = inf_{x}{\hat F_m(x) ≥ p_{0, i}} and p_{0, i} runs through ps.

Author(s)

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)

logcondens

Estimate a Log-Concave Probability Density from Iid Observations

v2.1.5
GPL (>= 2)
Authors
Kaspar Rufibach <kaspar.rufibach@gmail.com> and Lutz Duembgen <duembgen@stat.unibe.ch>
Initial release
2016-07-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.