lkden(x, lambda = NULL, extracentres = NULL, log = TRUE)
nlkden(lambda, x, extracentres = NULL, finitelik = FALSE)
NULL
fkden
fkden
.
They are designed to be used for MLE in
fkden
but are available for
wider usage, e.g. constructing your own extreme value
mixture models.
See fkden
and
fgpd
for full details.
Cross-validation likelihood is used for kernel density
component, obtained by leaving each point out in turn and
evaluating the KDE at the point left out:
$$L(\lambda)\prod_{i=1}^{n} \hat{f}_{-i}(x_i)$$ where
$$\hat{f}_{-i}(x_i) = \frac{1}{(n-1)\lambda}
\sum_{j=1: j\ne i}^{n} K(\frac{x_i - x_j}{\lambda})$$ is
the KDE obtained when the $i$th datapoint is dropped
out and then evaluated at that dropped datapoint at
$x_i$.
Normally for likelihood estimation of the bandwidth the
kernel centres and the data where the likelihood is
evaluated are the same. However, when using KDE for
extreme value mixture modelling the likelihood only those
data in the bulk of the distribution should contribute to
the likelihood, but all the data (including those beyond
the threshold) should contribute to the density estimate.
The extracentres
option allows the use to specify
extra kernel centres used in estimating the density, but
not evaluated in the likelihood. The default is to just
use the existing data, so extracentres=NULL
.
Log-likelihood calculations are carried out in
lkden
, which takes bandwidth
in the same form as distribution functions. The negative
log-likelihood is a wrapper for
lkden
, designed towards making
it useable for optimisation (e.g. parameters are given a
vector as first input).
The function lkden
carries out
the calculations for the log-likelihood directly, which
can be exponentiated to give actual likelihood using
(log=FALSE
).density
Other kden: dkden
, fkden
,
kden
, pkden
,
qkden
, rkden