[R] calculationg condition numbers

Christoph Lehmann lehmann at puk.unibe.ch
Wed Feb 26 15:39:03 CET 2003


am I right in the assumption, that for calculation of the condition
numbers I have to use the correlation matrix of X, and not t(x) %*% x?

> e <- eigen(t(x) %*% x)

better (x must not have a first column of ones): 
> e <- eigen(cor(x))


> e$val
[1] 6.6653e+07 2.0907e+05 1.0536e+05 1.8040e+04 2.4557e+01 2.0151e+00
> sqrt(e$val[1]/e$val)
[1] 1.000 17.855 25.153 60.785 1647.478 5751.216

thanks

christoph
-- 
Christoph Lehmann                            Phone:  ++41 31 930 93 83 
Department of Psychiatric Neurophysiology    Mobile: ++41 76 570 28 00
University Hospital of Clinical Psychiatry   Fax:    ++41 31 930 99 61 
Waldau                                            lehmann at puk.unibe.ch 
CH-3000 Bern 60            http://www.puk.unibe.ch/cl/pn_ni_cv_cl.html




More information about the R-help mailing list