To perform canonical conformance analysis (cca package ade4), I need a positive definite variance matrix. (Which in theory always holds) but:
matrix(c(2,59,4,7,10,0,7,0,0,0,475,18714,4070,97,298,0,1,0,17,7,4,1,4,18,36),nrow=5) > a [,1] [,2] [,3] [,4] [,5] [1,] 2 0 475 0 4 [2,] 59 7 18714 1 1 [3,] 4 0 4070 0 4 [4,] 7 0 97 17 18 [5,] 10 0 298 7 36 > eigen(var(a)) $values [1] 6.380066e+07 1.973658e+02 3.551492e+01 1.033096e+01 [5] -1.377693e-09
The last eigenvalue is -1.377693e-09 , which is <0. But the theoretical value is β 0.
I cannot run the function if one of the eigenvalues ββis <0
I really don't know how to fix this without changing the cca () function code
thanks for the help