The statistical definition is that for a p.d. matrix A, all quadratic forms x'Ax are positive, with x an arbitrary vector of appropriate dimension. A p.d. covariance matrix implies that all variances are positive, that all correlations are less than unity (absolute value), and that all partial correlations are consistent with each other.
How can you tell whether a matrix is p.d. or not? The easiest way to decide whether a matrix is p.d. is to inspect its eigenvalues or its Cholesky decomposition. There are many software packages available to do this. For instance, in R eigen()
will give you the eigenvalue decomposition and chol()
the Cholesky factor (you can also use the −−inveig
option in WOMBAT to look at eigenvalues).
A p.d. matrix cannot have any negative or zero eigenvalues or non-positive `pivots' (diagonal elements) in the Cholesky factor. This is the requirement for standard, full rank analyses in WOMBAT; for reduced rank analyses via the PC option, the number of non-zero eigenvalues (or pivots) has to be at least equal to the number of principal components fitted.
How does WOMBAT deal with matrices that are not p.d.? During estimation, WOMBAT constrains estimated matrices to have these properties, checking eigenvalues at each iteration step.
However, if it finds a `invalid' matrix of starting values, it will stop with an error message. While the program could, in principle, readily carry out the necessary calculations to modify such `invalid' starting values, this may lead to rather bad starting values and is thus not done.
Update: Recent versions of WOMBAT will attempt to 'fix' matrices of starting values which are just a little bit 'off', i.e. have eigenvalues close to zero, to make life easier. However, it is still best if you make sure your starting values are appropriate - your analysis will run faster and be less less likely to run into problems if you provide starting values derived from preliminary uni- and bivariate analyses and matrices which are safely positive-definite!
What can you do about it? To fix the problem, modify your input matrix until all eigenvalues are positive. WOMBAT uses a Cholesky factorization to check starting values. If the error message complains about a (negative) pivot close to zero, adding a small constant to the diagonals is often sufficient to make a matrix p.d.; if the negative pivot is not close to zero, something else is likely to have gone wrong – this could be as simple as a typing error or having specified the lower rather than the upper triangle of the covariance matrix.