Matrix ComputeSymPosDefMatrix( Matrix mDim )
The return value is an mDim x mDim matrix that is symmetric and positive definite.
Matrix mDim
The number of rows and columns in the returned matrix.
This module generates a symmetric positive definite matrix of a given size. Some algorithms require a symmetric positive definite matrix, for example the Cholesky matrix decomposition (see the SAS/IML ROOT function) or the linear conjugate gradient algorithm. Symmetric positive definite matrices arise naturally in statistics as the cross product matrix A`A where A has full column rank. The matrix returned by this module is not necessarily a cross-product matrix.
m = ComputeSymPosDefMatrix( 5 ); print m;