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,
...
)
Potential solution vector of length nx
.
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.
Logical, whether a maximum or a minimum of the objective function is sought.
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)
.
Number of points in each projection 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()
).
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.
plot
, summary
, print
, and diff
methods for projection plots are available; see plot.optproj()
, summary.optproj()
, print.optproj()
, and diff.optproj()
.