gridsearch2d: Graphical grid search in 2D

View source: R/utils3d.R

gridsearch2dR Documentation

Graphical grid search in 2D

Description

Given an objective function and starting ranges, computes the values over the ranges and displays them in the graphics window. User can then interactively zoom in to view interesting parts of the surface.

Usage

gridsearch2d(fun, v1min, v2min, v1max, v2max,
n1 = 20, n2 = 20, logz = FALSE,
sys3d = c("both", "contour", "image"), ...)

Arguments

fun

Objective function to be minimized: function of two arguments

v1min

Minimum starting value of variable 1

v2min

Minimum starting value of variable 2

v1max

Maximum starting value of variable 1

v2max

Maximum starting value of variable 2

n1

Number of grid points for variable 1

n2

Number of grid points for variable 2

logz

Display image or contour on log scale?

sys3d

Display surface as an image, contour, or both?

...

Other arguments to fun

Details

If log=TRUE, the value of the surface is rescaled to log10(m-min(m)+mindm), where mindm is the difference between the minimum and the next-largest value (or 1e-10 if this difference is zero).

At each iteration, the user is prompted to select two corners of the new range with the mouse; if this choice is confirmed then the view zooms in. When the user chooses to quit, they are asked whether they want to choose a final point (e.g. an estimate of the minimum) with the mouse.

Value

If a final point is chosen, a list with elements x and y, otherwise NULL.

Author(s)

Ben Bolker

See Also

curve3d


emdbook documentation built on July 9, 2023, 6:33 p.m.