Re: [R] solve() versus ginv()

2005-10-16 Thread Peter Dalgaard
Werner Bier [EMAIL PROTECTED] writes:

 Dear All,
  
 While inverting a matrix the following error appears on my console:
  
 Error in solve.default(my_matrix) : Lapack routine dgesv: system is exactly 
 singular
  
 With this respect, I have been replacing the solve() function with ginv(): 
 the Moore-Penrose generalized inverse of a matrix. 
  
 These are the questions I would like to ask you:
  
 1. Would you also replace solve() with ginv() in these scenarios and using R? 
 2. Or is there something I should take care by using ginv() you would suggest 
 me please? 

Well, generalized inverses work by setting 1/0 == 0, broadly speaking.
If the system has a zero eigenvalue, the r.h.s. is projected onto the
span of the matrix. (In the symmetric, positive semidefinite case,
anyway).

In statistical terms, this means that there is a direction along which
you have no information on your parameters (infinite s.e.), and the
g.inv. solves this by assuming that the effect in that direction is
zero (with zero s.e.!). This can be a sensible thing to do, but I
wouldn't be happy about having the choice made for me automatically...

-- 
   O__   Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] solve() versus ginv()

2005-10-15 Thread Werner Bier
Dear All,
 
While inverting a matrix the following error appears on my console:
 
Error in solve.default(my_matrix) : Lapack routine dgesv: system is exactly 
singular
 
With this respect, I have been replacing the solve() function with ginv(): the 
Moore-Penrose generalized inverse of a matrix. 
 
These are the questions I would like to ask you:
 
1. Would you also replace solve() with ginv() in these scenarios and using R? 
2. Or is there something I should take care by using ginv() you would suggest 
me please? 
 
Many thanks in advance.
 
Best regards,
Werner



-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html