After the
handle has been initialized (e.g.,
e04rac has been called),
e04rfc may be used to define the objective function of the problem as a quadratic function
or a sparse linear function
. If the objective function has already been defined, it will be overwritten. If
e04rfc is called with no nonzeroes in either
or
,
any existing objective function is removed, no new one is added and the problem will be solved as a feasible point problem.
e04tec may be used to set individual elements
of the linear objective.
Linear Programming (LP)
Quadratic Programming problems (QP)
or for Semidefinite Programming problems with bilinear matrix inequalities (BMI-SDP)
The matrix
is a sparse symmetric
matrix. It does not need to be positive definite. 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: .
On entry, .
Constraint: .
- NE_INTARR
-
On entry, , and .
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: (elements within the upper triangle).
On entry, , and .
Constraint: .
On entry, more than one element of
h has row index
and column index
.
Constraint: each element of
h 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_NOT_INCREASING
-
On entry, , and .
Constraint: (ascending order).
- 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.
This example demonstrates how to use nonlinear semidefinite programming to find a nearest correlation matrix satisfying additional requirements. This is a viable alternative to functions
g02aac,
g02abc,
g02ajc or
g02anc as it easily allows you to add further constraints on the correlation matrix. In this case a problem with a linear matrix inequality and a quadratic objective function is formulated to find the nearest correlation matrix in the Frobenius norm preserving the nonzero pattern of the original input matrix. However, additional box bounds (
e04rhc) or linear constraints (
e04rjc) can be readily added to further bind individual elements of the new correlation matrix or new matrix inequalities (
e04rnc) to restrict its eigenvalues.
The problem is as follows (to simplify the notation only the upper triangular parts are shown). To a given
symmetric input matrix
find correction terms
which form symmetric matrix
so that the following requirements are met:
-
(a)It is a correlation matrix, i.e., symmetric positive semidefinite matrix with a unit diagonal. This is achieved by the way is assembled and by a linear matrix inequality
-
(b) is nearest to in the Frobenius norm, i.e., it minimizes the Frobenius norm of the difference which is equivalent to:
-
(c) preserves the nonzero structure of . This is met by defining only for nonzero elements .
See also
e04rac for links to further examples in the suite.