build_grid: Build the grid for the grid search algorithm with a zoom.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function builds the grid for the grid search algorithm with a zoom.

Usage

1

Arguments

...

a sequence of vectors or lists containing the information about the grid to be built, see Usage and Details.

Details

The argument ... is a sequence of vectors or lists contatining the information about the grid to be built. Each element in the sequence is either a vector or a list taking one of the following forms

- x, if x is already an sequence of the grid points for the corresponding argument.

- c(from=, to=, by=)

- c(from=, to=, length=)

- list(from=, to=, by=)

- list(from=, to=, length=)

where

- from: the min of the argument of the target function

- to: the max of the argument of the target function

- by: the increment of the sequence

- length: desired length.

There are many different ways to organize the points on the grid for certain argument of the target function, the user can make them freely and input directly by build_grid(x, ...). Notice that x does not need to be increasing, as the function will sort it. The design that x does not need to be increasing makes it convenient for the user to interpolate more points at some region without considering to sort it all the time.

When by is provided, the length will be ignored. So if the user wanna specify the length, please do not use by.

The order of the sequence ... matters as it represents the order of the corresponding arguments of the target function to be optimized.

Value

a new object of the class GRID with the grid ready for the grid search with a zoom.

The object contains the following components:

grid

the grid

size

number of points in the grid

npar

number of arguments or parameters

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

See Also

grid_search_check, grid_search

Examples

1
2
vx = 1:5
build_grid(vx, c(from=1, to=2, by=.2), list(from=3, to=4, length=5))

zoomgrid documentation built on May 2, 2019, 2:41 a.m.