fun: An unconstrained cost function returning a numeric scalar, similar to those used in the fminsearch function.
x0: The initial point estimate, provided as a numeric vector.
xmin: Optional: a vector of lower bounds.
xmax: Optional: a vector of upper bounds.
npts: An integer scalar greater than 2, indicating the number of evaluation points will be used on each dimension to build the search grid.
alpha: A vector of numbers greater than 1, which give the factor(s) used to calculate the evaluation range of each dimension of the search grid (see Details). If alpha length is lower than that of x0, elements of alpha are recycled. If its length is higher than that of x0, alpha is truncated.
Details
fmin.gridsearch evaluates the cost function at each point of a grid of npts^length(x0) points. If lower (xmin) and upper (xmax) bounds are provided, the range of evaluation points is limited by those bounds and alpha is not used. Otherwise, the range of evaluation points is defined as [x0/alpha,x0*alpha].
The actual evaluation of the cost function is delegated to optimbase.gridsearch.
Returns
Return a data.frame with the coordinates of the evaluation point, the value of the cost function and its feasibility. Because the cost function is unconstrained, it is always feasible. The data.frame is ordered by feasibility and increasing value of the cost function.