Learn R Programming

pi0 (version 1.3-250)

grid.search: Performs a grid search to minimize the objective function

Description

Performs a grid search to minimize the objective function

Usage

grid.search(obj, lower, upper, ngrid, ...)

Arguments

obj
objective function to be minimized
lower
numeric vector giving the lower bound of grid for each dimension
upper
numeric vector giving the upper bound of grid for each dimension
ngrid
numeric vector giving the number of points each dimension
...
other arguments passed to obj

Value

  • a numeric vector of the parameter that minimizes obj

Details

This function first call expand.grid then evaluate obj to find a minimum. The number of calls to obj is prod(ngrid). This is useful for finding a good starting values for many optimization routines.

See Also

optim