After the
handle has been initialized (e.g.,
e04raf has been called),
e04rmf may be used to declare the objective function of the optimization problem as a sum of squares. If the objective function has already been defined, it will be overwritten. It will typically be used in data fitting or calibration problems of the form
where
$x$ is an
$n$-dimensional variable vector and
${r}_{j}\left(x\right)$ are nonlinear residuals (see
Section 2.2.3 in the
E04 Chapter Introduction). The values of the residuals, and possibly their derivatives, will be communicated to the solver by a user-supplied function.
e04rmf also allows the structured first derivative matrix
to be declared as being dense or sparse. If declared as sparse, its sparsity structure must be specified by
e04rmf. If
e04rmf is called with
${m}_{r}=0$,
any existing objective function is removed, no new one is added and the problem will be solved as a feasible point problem.
Note that it is possible to temporarily disable and enable individual residuals in the model by
e04tcf and
e04tbf, respectively.
See
Section 3.1 in the
E04 Chapter Introduction for more details about the NAG optimization modelling suite.
None.
If on entry
${\mathbf{ifail}}=0$ or
$\mathrm{-1}$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Not applicable.
Internal changes have been made to this routine as follows:
- At Mark 27.1: Previously, it was not possible to modify the objective function once it was set or to edit the model once a solver had been called. These limitations have been removed and the associated error codes were removed.
For details of all known issues which have been reported for the NAG Library please refer to the
Known Issues.
In this example, we demonstrate how to declare a least squares problem through
e04rmf and solve it with
e04fff on a very simple example. Here
$n=2$,
${m}_{r}=3$ and the residuals are computed by:
The expected result is:
with an objective value of
$0.015$.
See also the examples in Section 10 in
e04fff and
e04kff.
None.