quantilesLogConDens {logcondens} | R Documentation |
Function to compute p_0-quantile of
widehat F_m(t) = int_{x_1}^t widehat f_m(t) dt,
where widehat f_m is the log-concave density estimator, received via activeSetLogCon
.
quantilesLogConDens(p0, x, f, F, IsKnot)
p0 |
Real number where quantil should be computed. |
x |
Sorted vector of original observations x = (x_1, ..., x_m). |
f |
Vector (widehat f_m(x_1), ..., widehat f_m(x_m)), representing the function widehat f_m, as computed by activeSetLogCon . |
F |
Vector (widehat F_{m,i})_{i=1}^m with entries widehat F_{m,i} = int_{x_1}^{x_i} exp(widehat varphi_m(t)) dt, as computed by |
IsKnot |
Column vector with entries IsKnot_i = 1{widehat varphi_m has a kink at x_i}, as computed by activeSetLogCon . |
Returns the real number q_0 = inf_{x}{widehat F_m(x) >= p_0}.
Since the log-density is piecewise linear, the corresponding distribution function can be analytically
computed from x and widehat varphi_m. The function quantilesLogConDens
simply inverts this analytical function. However, for extreme quantiles
(that are of course still smaller than x_m) and m big, this may be numerically unstable and should be
replaced by numerical search (e.g. bisection).
Kaspar Rufibach, kaspar.rufibach@stanford.edu,
http://www.stanford.edu/~kasparr
Lutz Duembgen, duembgen@stat.unibe.ch,
http://www.stat.unibe.ch/~duembgen
## estimate gamma density set.seed(1977) x <- sort(rgamma(200, 2, 1)) res <- activeSetLogCon(x, w = NA, print = FALSE) ## compute 0.95 quantile of estimated F quantilesLogConDens(0.95, x, exp(res$phi), res$F, res$IsKnot)