optimize_bw: Find positive minimizer with the input function

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
optimize_bw(f, h0, ...)

Arguments

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.

Value

The output of the nlm function.

Author(s)

Guillermo Basulto-Elias

Examples

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)

gbasulto/kerdec documentation built on June 5, 2019, 10:58 a.m.