"Angel" <[EMAIL PROTECTED]> writes:

> Why do
> x<-b%*%ginv(A)
> and
> x<-solve(A,b)
> give different results?. It seems that I am missing some basic feature of
> matrix indexing.
> e.g.:
> 
> A<-matrix(c(0,-4,4,0),nrow=2,ncol=2)
> b<-c(-16,0)
> x<-b%*%ginv(A);x
> x<-solve(A,b);x

[ginv() is from MASS, please remember to tell us]

Your b is on the wrong side, try ginv(A)%*%b (possibly put it within
drop() to convert it to vector).

 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])             FAX: (+45) 35327907

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to