evaluateLogConDens {logcondens} | R Documentation |
Based on the output of the function activeSetLogCon
, this gives the values of the
functions
widehat varphi_m(t)
widehat f_m(t) = exp(widehat varphi_m(t))
widehat F_m(t) = int_{x_1}^t exp(widehat varphi_m(t)) dt
at an arbitrary real number t = x_0. The exact formula for widehat F_m and t in [x_j,x_{j+1}] is
widehat F_m(t) = widehat F_m(x_j) + (x_{j+1}-x_j) JBig(widehat varphi_j, widehat varphi_{j+1}, frac{t-x_j}{x_{j+1}-x_j} Big)
for the function J introduced in Jfunctions
.
evaluateLogConDens(x0, x, phi, Fhat, IsKnot)
x0 |
Real number where the functions should be evaluated at. |
x |
Vector {x} = (x_1, ..., x_m) of original observations (sorted). |
phi |
Vector (widehat varphi_m(x_i))_{i=1}^m, as computed by activeSetLogCon . |
Fhat |
Vector (widehat F_m(x_i))_{i=1}^m, as computed by activeSetLogCon . |
IsKnot |
0-1 vector giving the kinks of widehat varphi_m, as computed by activeSetLogCon . |
Vector (widehat varphi_m(x_0), widehat f_m(x_0), widehat F_m(x_0)).
Kaspar Rufibach, kaspar.rufibach@gmail.com
Lutz Duembgen, duembgen@stat.unibe.ch,
http://www.staff.unibe.ch/duembgen
This function uses the output of activeSetLogCon
.
For log-concave density estimation via an iterative convex minorant algorithm see icmaLogCon
.
## estimate gamma density set.seed(1977) x <- sort(rgamma(200, 2, 1)) res <- activeSetLogCon(x, w = NA, print = FALSE) ## compute function values at an arbitrary point x0 <- (x[100] + x[101]) / 2 evaluateLogConDens(x0, x, res$phi, res$Fhat, res$IsKnot)