# naginterfaces.library.correg.corrmat_​target¶

naginterfaces.library.correg.corrmat_target(g, theta, h, errtol=0.0, eigtol=0.0)[source]

corrmat_target computes a correlation matrix, by using a positive definite target matrix derived from weighting the approximate input matrix, with an optional bound on the minimum eigenvalue.

For full information please refer to the NAG Library document for g02ap

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/g02/g02apf.html

Parameters
gfloat, array-like, shape

, the initial matrix.

thetafloat

The value of . If , is used.

hfloat, array-like, shape

The matrix of weights .

errtolfloat, optional

The termination tolerance for the iteration.

If , is used.

See Accuracy for further details.

eigtolfloat, optional

The tolerance used in determining the definiteness of the target matrix .

If , where and denote the minimum and maximum eigenvalues of respectively, is positive definite.

If , machine precision is used.

Returns
hfloat, ndarray, shape

A symmetric matrix with its diagonal elements set to .

xfloat, ndarray, shape

Contains the matrix .

alphafloat

The constant used in the formation of .

iteraint

The number of iterations taken.

eigminfloat

The smallest eigenvalue of the target matrix .

normfloat

The value of after the final iteration.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

The target matrix is not positive definite.

(errno )

Starting from an approximate correlation matrix, , corrmat_target finds a correlation matrix, , which has the form
corrmat_target utilizes a shrinking method to find the minimum value of such that is positive definite with unit diagonal and with a smallest eigenvalue of at least times the smallest eigenvalue of the target matrix.