After the initialization routine
e04raf has been called and unless the objective function has already been defined,
e04rmf may be used to declare the objective function of the optimization problem as a sum of squares. It will typically be used in data fitting or calibration problems of the form
where
is an
-dimensional variable vector and
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 user to declare the structured first derivative matrix
as being dense or sparse. If declared as sparse, its sparsity structure must be specified here.
None.
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Not applicable.
None.
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
,
and the residuals are computed by:
The expected result is:
with an objective value of
.
None.