After the initialization function
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
unless the objective function has already been defined by another function in the suite. This objective function will typically be used for linear programming (LP)
quadratic programming problems (QP)
or for semidefinite programming problems with bilinear matrix inequalities (BMI-SDP)
The matrix
is a sparse symmetric
by
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_ALREADY_DEFINED
-
The objective function has already been defined.
- 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 initialized by
e04rac 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 in this phase any more, the solver has already been called.
Not applicable.
None.
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
by
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
Section 10 in
e04rac for links to further examples in the suite.