Unlimited learning, half price | 50% off
Get 50% off unlimited learning

logcondens (version 2.0.2)

evaluateLogConDens: Evaluates the Log-Density MLE and Smoothed Estimator at Arbitrary Real Numbers xs

Description

Based on the output of activeSetLogCon, this function computes the values of ϕ^m(t) f^m(t)=exp(ϕ^m(t)) F^m(t)=x1texp(ϕ^m(x))dx f^m(t)=exp(ϕ^m(t)) F^m(t)=x1texp(ϕ^m(x))dx at all real number $t$ in xs. The exact formula for $\widehat F_m$ and $t \in [x_j,x_{j+1}]$ is F^m(t)=F^m(xj)+(xj+1xj)J(ϕ^j,ϕ^j+1,txjxj+1xj) for the function $J$ introduced in Jfunctions. Closed formulas can also be given for $\widehat f_m^*(t)$ and $\widehat F_m^*(t)$.

Usage

evaluateLogConDens(xs, res, which = 1:5, gam = NULL, print = FALSE)

Arguments

xs
Vector of real numbers where the functions should be evaluated at.
res
An object of class "dlc", usually a result of a call to logConDens.
which
A (sub-)vector of 1:5 specifying which of the above quantities should be computed.
gam
Only necessary if smoothed = TRUE. The standard deviation of the normal kernel. If equal to NULL, gam is chosen such that the variances of the original sample $x_1, \ldots, x_n$ and $\wide
print
Progress in computation of smooth estimates is shown.

Value

  • Matrix with rows $(x_{0, i}, \widehat \phi_m(x_{0, i}), \widehat f_m(x_{0, i}), \widehat F_m(x_{0, i}), \widehat f_m^*(x_{0, i}), \widehat F_m^*(x_{0, i}))$ where $x_{0,i}$ is the $i$-th entry of xs.

Examples

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

## compute function values at an arbitrary point
xs <- (res$x[100] + res$x[101]) / 2
evaluateLogConDens(xs, res)

## only compute function values for non-smooth estimates
evaluateLogConDens(xs, res, which = 1:3)

Run the code above in your browser using DataLab