On 10/12/15 23:08, Stefano Sofia wrote:
Dear list users,
through the "matrixcalc" package I am performing some checks of variance
matrices (which must be positive definite).
In this example, it happens that the matrix A here reported is singular but
positive definite. Is it possible?
[,1] [,2] [,3] [,4]
[1,] 1.904255e-12 -1.904255e-12 -8.238960e-13 -1.240294e-12
[2,] -1.904255e-12 3.637979e-12 1.364242e-12 1.818989e-12
[3,] -8.238960e-13 1.364242e-12 4.809988e+00 7.742369e-01
[4,] -1.240294e-12 1.818989e-12 7.742369e-01 1.090411e+00
print(is.non.singular.matrix(A, tol = 1e-18))
FALSE
print(is.positive.definite(A, tol=1e-18))
TRUE
Is there something wrong with this matrix?
Any comment will be appreciated.
There is nothing wrong with A (at least nothing that either a nice bowl
of chicken soup or a bloody good swim wouldn't cure).
Look at the code for the two functions. The tests use the tolerance in
very different ways.
My initial reaction is that the code for these functions is rather naive.
cheers,
Rolf Turner
--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.