You are here

error checking for correlation matrices -- Complete!

We have a function called "verifyCovarianceMatrix" in the front-end that does some sanity checking on covariance matrices. What types of error checking are needed for correlation matrices? This assignment is for Ross, because we weren't using our bug report interface. "verifyCovarianceMatrix" does the following:
- matrix is square?
- matrix has NA values?
- matrix is symmetric?
- matrix is positive-definite?

Reporter: 
Created: 
Tue, 06/07/2011 - 18:00
Updated: 
Tue, 11/08/2011 - 11:43

Comments

verifyCorrelationMatrix should (in addition to the requirements above) also ensure:

  • every element on matrix diagonal is 1.0
  • no matrix elements are outside of the range [-1.0, 1.0]

The -1 to 1 condition would be covered by the positive definite test and the diagonal of 1's and therefore doesn't need to be performed as well.

I've checked in the function to MxData and added a test to models/passing/InitializationErrorDetection.R. Thanks for the requirements gathering help!

Automatically closed -- issue fixed for 2 weeks with no activity.