Description Usage Arguments Value Author(s) Examples
Most methods used to find optimal bandwidths require to minimize a function (tipically MISE, AMISE, CV, ...). The argument ought to be positive. The fastest method that I empirically found was nlm. If the function is evaluated at a negative number or the output is not finite or not a number, the function will return the maximum possible number, so nlm can work better with the input function.
1 | optimize_bw(f, h0, ...)
|
f |
Function to be minimized. Tipically a version of CV, MISE or AMISE. |
h0 |
Initial bandwidth value. |
... |
Arguments passed to f besides the first argument, which must be the bandwidth. |
The output of the nlm function.
Guillermo Basulto-Elias
1 2 3 4 5 6 7 8 | ## Not run:
## Bad initial point (it is negative).
kerdec:::optimize_bw(function(x) x^2, -5)
## End(Not run)
## Good initial point.
kerdec:::optimize_bw(function(x) x^2, 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.