Home > atmlab > covmat > covmat_test.m

covmat_test

PURPOSE ^

COVMAT_TEST Tests if a covariance matrix is postive definite

SYNOPSIS ^

function covmat_test(S)

DESCRIPTION ^

 COVMAT_TEST   Tests if a covariance matrix is postive definite

   An error is issued if not OK.

 FORMAT   covmat_test( S )
        
 IN    S     The covariance matrix

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

covmat_test.m

SOURCE CODE ^

0001 % COVMAT_TEST   Tests if a covariance matrix is postive definite
0002 %
0003 %   An error is issued if not OK.
0004 %
0005 % FORMAT   covmat_test( S )
0006 %
0007 % IN    S     The covariance matrix
0008 
0009 % 2005-05-23   Created by Patrick Eriksson.
0010 
0011 
0012 function covmat_test(S)
0013 
0014 
0015 [R,p] = chol( S );
0016 
0017 if p
0018   error( 'Matrix is not positive definite.' );
0019 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005