Given the objective function of an optimization problem and a potential solution, calculates "projection plots" along each coordinate of the solution vector, with all other coordinates being fixed at the input values.

optim_proj(
  xsol,
  fun,
  maximize = TRUE,
  xrng = 0.1,
  npts = 100,
  plot = TRUE,
  ...
)

Arguments

xsol

Potential solution vector of length nx.

fun

Objective function to be maximized (or minimized), with first argument the length-nx parameter vector over which optimization is to take place. Should return a scalar result.

maximize

Logical, whether a maximum or a minimum of the objective function is sought.

xrng

Optional specification of the range of each projection plot. Can be: (i) a 2 x nx matrix giving the endpoints of the range, (ii) a scalar or vector of length nx, such that the range in each plot is theta +/- xrange * abs(theta).

npts

Number of points in each projection plot.

plot

Logical, whether or not to display the projection plots or just return their contents.

...

Further arguments to pass to the plot method (see plot.optproj()).

Value

An object of class optproj inheriting from optcheck (returned invisibly if plot = TRUE, with elements:

xsol

The potential solution.

ysol

The value of fun(xsol).

maximize

Logical indicating whether the potential solution should maximize or minimize the objective function.

xproj

An npts x nx matrix where each column is the x-axis of the projection plot along the given component of theta.

yproj

An npts x nx matrix where each column is the y-axis of the corresponding projection plot.

See also

plot, summary, print, and diff methods for projection plots are available; see plot.optproj(), summary.optproj(), print.optproj(), and diff.optproj().