[R] using SVD to get an inverse matrix of covariance matrix

ge yreyt tothri2000 at yahoo.ca
Fri Jul 11 17:49:51 CEST 2003

Dear R-users,

I have one question about using SVD to get an inverse
matrix of covariance matrix

Sometimes I met many singular values d are close to 0:
look this example

 [1] 4.178853e+00 2.722005e+00 2.139863e+00
1.867628e+00 1.588967e+00
 [6] 1.401554e+00 1.256964e+00 1.185750e+00
1.060692e+00 9.932592e-01
[11] 9.412768e-01 8.530497e-01 8.211395e-01
8.077817e-01 7.706618e-01
[16] 7.007119e-01 6.237449e-01 5.709922e-01
5.550645e-01 5.062633e-01
[21] 4.792278e-01 4.222183e-01 3.660419e-01
3.293667e-01 3.026312e-01
[26] 2.942821e-01 2.811098e-01 2.626359e-01
2.199134e-01 1.943776e-01
[31] 1.712359e-01 1.561616e-01 1.359116e-01
1.280704e-01 1.099847e-01
[36] 1.013633e-01 9.622151e-02 8.396722e-02
7.083654e-02 6.755967e-02
[41] 5.392306e-02 3.807169e-02 2.942905e-02
2.726249e-02 4.555067e-16
[46] 3.095299e-16 2.918951e-16 2.672369e-16
2.336190e-16 2.239488e-16
[51] 2.089471e-16 1.970283e-16 1.863823e-16
1.775903e-16 1.698164e-16
[56] 1.594850e-16 1.500927e-16 1.469157e-16
1.406057e-16 1.366468e-16
[61] 1.319553e-16 1.252144e-16 1.193341e-16
1.142526e-16 1.064905e-16
[66] 1.040117e-16 1.005124e-16 9.310727e-17
8.995158e-17 8.529797e-17
[71] 8.204344e-17 7.759612e-17 7.478445e-17
7.225679e-17 6.709050e-17
[76] 5.996665e-17 5.830386e-17 5.687619e-17
5.121094e-17 4.848857e-17
[81] 4.549679e-17 4.307547e-17 3.830520e-17
3.450571e-17 3.312035e-17
[86] 3.260300e-17 2.399392e-17 2.141970e-17
1.996962e-17 1.881993e-17
[91] 1.567323e-17 1.062695e-17 6.730278e-18
2.118570e-18 4.991002e-19

Since the inverse matrix = u * inverse(d) * v',
If I calculate inverse d based on formula : 1/d, then
most values of inverse matrix
will be huge. This must be not a good way. MOre
special case, if a single value is 0, then
we can not calculate inverse d based on 1/d.

Therefore, my question is how I can calculate inverse
d (that is inverse diag(d) more efficiently???



Post your free ad now! http://personals.yahoo.ca

More information about the R-help mailing list