/** * This is a fairly light weight check to see of a covariance matrix is valid. * It checks to see if the diagonal elements are all positive, which they should be * if it is valid. Not all invalid covariance matrices will be caught by this method. * * @return true if valid and false if invalid */ public static boolean isValidFast( DenseMatrix64F cov ) { return MatrixFeatures.isDiagonalPositive(cov); }
/** * This is a fairly light weight check to see of a covariance matrix is valid. * It checks to see if the diagonal elements are all positive, which they should be * if it is valid. Not all invalid covariance matrices will be caught by this method. * * @return true if valid and false if invalid */ public static boolean isValidFast( DenseMatrix64F cov ) { return MatrixFeatures.isDiagonalPositive(cov); }
/** * This is a fairly light weight check to see of a covariance matrix is valid. * It checks to see if the diagonal elements are all positive, which they should be * if it is valid. Not all invalid covariance matrices will be caught by this method. * * @return true if valid and false if invalid */ public static boolean isValidFast( DenseMatrix64F cov ) { return MatrixFeatures.isDiagonalPositive(cov); }
/** * Performs a variety of tests to see if the provided matrix is a valid * covariance matrix. * * @return 0 = is valid 1 = failed positive diagonal, 2 = failed on symmetry, 2 = failed on positive definite */ public static int isValid( DenseMatrix64F cov ) { if( !MatrixFeatures.isDiagonalPositive(cov) ) return 1; if( !MatrixFeatures.isSymmetric(cov,TOL) ) return 2; if( !MatrixFeatures.isPositiveSemidefinite(cov) ) return 3; return 0; }
/** * Performs a variety of tests to see if the provided matrix is a valid * covariance matrix. * * @return 0 = is valid 1 = failed positive diagonal, 2 = failed on symmetry, 2 = failed on positive definite */ public static int isValid( DenseMatrix64F cov ) { if( !MatrixFeatures.isDiagonalPositive(cov) ) return 1; if( !MatrixFeatures.isSymmetric(cov,TOL) ) return 2; if( !MatrixFeatures.isPositiveSemidefinite(cov) ) return 3; return 0; }
/** * Performs a variety of tests to see if the provided matrix is a valid * covariance matrix. * * @return 0 = is valid 1 = failed positive diagonal, 2 = failed on symmetry, 2 = failed on positive definite */ public static int isValid( DenseMatrix64F cov ) { if( !MatrixFeatures.isDiagonalPositive(cov) ) return 1; if( !MatrixFeatures.isSymmetric(cov,TOL) ) return 2; if( !MatrixFeatures.isPositiveSemidefinite(cov) ) return 3; return 0; }