Evaluates the Log-Density MLE and Smoothed Estimator at Arbitrary Real Numbers xs
Based on a "dlc"
object generated by logConDens
, this function computes the values of
\hat φ_m(t)
\hat f_m(t) = exp(\hat φ_m(t))
\hat F_m(t) = int_{x_1}^t exp(\hat φ_m(x)) dx
\hat f_m^*(t) = exp(\hat φ_m^*(t))
\hat F_m^*(t) = int_{x_1}^t \exp(\hat φ_m^*(x)) dx
at all real number t in xs
. The exact formula for \hat F_m and t \in [x_j,x_{j+1}] is
\hat F_m(t) = \hat F_m(x_j) + (x_{j+1}-x_j) J(\hat φ_j, \hat φ_{j+1}, (t-x_j)/(x_{j+1}-x_j))
for the function J introduced in Jfunctions
. Closed formulas can also be given for \hat f_m^*(t)
and \hat F_m^*(t).
evaluateLogConDens(xs, res, which = 1:5, gam = NULL, print = FALSE)
xs |
Vector of real numbers where the functions should be evaluated at. |
res |
An object of class |
which |
A (sub-)vector of |
gam |
Only necessary if |
print |
Progress in computation of smooth estimates is shown. |
Matrix with rows (x_{0, i}, \hat φ_m(x_{0, i}), \hat f_m(x_{0, i}), \hat F_m(x_{0, i}), \hat f_m^*(x_{0, i}), \hat F_m^*(x_{0, i}))
where x_{0,i} is the i-th entry of xs
.
Kaspar Rufibach, kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.