Re: [R] Matrix negative fraction power

2012-03-11 Thread Berend Hasselman
On 11-03-2012, at 18:18, Berend Hasselman wrote: > > On 11-03-2012, at 17:52, Spencer Graves wrote: > >> If my memory is correct, the archives of this list contains several >> discussions of round off error problems associated with different methods >> for computing things like this. The

Re: [R] Matrix negative fraction power

2012-03-11 Thread Berend Hasselman
On 11-03-2012, at 17:52, Spencer Graves wrote: > If my memory is correct, the archives of this list contains several > discussions of round off error problems associated with different methods for > computing things like this. The "Matrix" package (part of the base > distribution) contai

Re: [R] Matrix negative fraction power

2012-03-11 Thread Spencer Graves
If my memory is correct, the archives of this list contains several discussions of round off error problems associated with different methods for computing things like this. The "Matrix" package (part of the base distribution) contains a function "expm", whose help file says, "The expm p

Re: [R] Matrix negative fraction power

2012-03-11 Thread Joshua Wiley
On Sun, Mar 11, 2012 at 8:56 AM, Peter Langfelder wrote: > On Sun, Mar 11, 2012 at 1:46 AM, Ebrahim Jahanshiri > wrote: >> Dear list, >> >> I understand that to raise matrix A to power (-1/2) we should use something >> like this: >> >> eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)

Re: [R] Matrix negative fraction power

2012-03-11 Thread Peter Langfelder
On Sun, Mar 11, 2012 at 1:46 AM, Ebrahim Jahanshiri wrote: > Dear list, > > I understand that to raise matrix A to power (-1/2) we should use something > like this: > > eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)$vectors) > > [from previous discussions: > http://r.789695.n4.nabbl

[R] Matrix negative fraction power

2012-03-11 Thread Ebrahim Jahanshiri
Dear list, I understand that to raise matrix A to power (-1/2) we should use something like this: eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)$vectors) [from previous discussions: http://r.789695.n4.nabble.com/matrix-power-td900335.html] But this will only do it for negative sq