After the
handle has been initialized (e.g.,
e04rac has been called),
e04rmc 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
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.
e04rmc 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
e04rmc. If
e04rmc is called with
,
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
e04tcc and
e04tbc, respectively.
See
Section 4.1 in the
E04 Chapter Introduction for more details about the NAG optimization modelling suite.
None.
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_HANDLE
-
The supplied
handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been properly initialized or it has been corrupted.
- NE_INT
-
On entry, .
Constraint: or .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_INVALID_CS
-
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
On entry, more than one element of first derivative matrix has row index and column index .
Constraint: each element of first derivative matrix must have a unique row and column index.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_PHASE
-
The problem cannot be modified right now, the solver is running.
Not applicable.
Internal changes have been made to this function 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
e04rmc and solve it with
e04ffc on a very simple example. Here
,
and the residuals are computed by:
The expected result is:
with an objective value of
.
See also the examples in Section 10 in
e04ffc and
e04kfc.
None.