MKLE {MKLE} | R Documentation |
Computes the maximum kernel likelihood estimator for a given dataset and bandwidth.
mkle(data, Kernel = dnorm, bw = 2*sd(data), small = TRUE)
data |
the data for which the log likelihood will be computed. |
Kernel |
a R function to be used as the kernel function. |
bw |
the smoothing bandwidth to be used. |
small |
logical; if 'TRUE', only the value of the estimator is returned. Otherwise the full optimization history will be included. |
The underlying shifted kernel density estimator is defined as
1/(nh)sum K((y-X_i-bar X+theta)/h).
The default for the bandwidth is 2*sigma, which is the optimal value if a Gaussian kernel is used.
The MKLE or a list with components:
par |
The best set of parameters found. |
value |
The value of klik corresponding to par . |
counts |
A two-element integer vector giving the number of calls to Klik . This excludes those calls needed to compute the Hessian, if requested, and any calls to fn to compute a finite-difference approximation to the gradient. |
convergence |
An integer code. '0' indicates successful convergence.
Error codes are
'1' indicates that the iteration limit 'maxit' had been reached. '10' indicates degeneracy of the Nelder-Mead simplex. '51' indicates a warning from the '"L-BFGS-B"' method; see component 'message' for further details. '52' indicates an error from the '"L-BFGS-B"' method; see component 'message' for further details. |
message |
A character string giving any additional information returned by the optimizer, or 'NULL'. |
The optim
with the method 'BFGS' is used for the optimization.
Thomas Jaki
~not yet~
data(state) attach(state) mkle(crime)