[R] Communative Matrix Multiplcation

Martin Maechler maechler at stat.math.ethz.ch
Thu Aug 16 09:42:00 CEST 2012


>>>>> David Reiner <David.Reiner at xrtrading.com>
>>>>>     on Wed, 15 Aug 2012 09:59:10 -0500 writes:

    > As a mathematician, I have to correct the subject line
    > to 'Distributive Matrix operations' -- David

Yes, indeed; 
that was *really* disturbing to me as well, about this thread!

{in addition to the fact that he should have used all.equal()
 and not identical()  as someone had pointed out already ..}

And at last: Yes,  some of the methods for Diagonal() matrices in the
 'Matrix' package did have bugs, in earlier versions.

NOTE: You can (and often should) update packages also if for
     some reason you cannot update your version of R!

Martin Maechler,  ETH Zurich

    > -----Original Message----- From:
    > r-help-bounces at r-project.org
    > [mailto:r-help-bounces at r-project.org] On Behalf Of
    > Doran, Harold Sent: Tuesday, August 14, 2012 12:55 PM
    > To: Berend Hasselman Cc: 'r-help at r-project.org' Subject:
    > Re: [R] Communative Matrix Multiplcation

    > Thanks, Berend. I updated my R and got same result. I
    > reposted the old sessionInfo(), which was an older
    > version. But, same code, same matrices, different result

    >> -----Original Message----- From: Berend Hasselman
    >> [mailto:bhh at xs4all.nl] Sent: Tuesday, August 14, 2012
    >> 1:49 PM To: Doran, Harold Cc: 'r-help at r-project.org'
    >> Subject: Re: [R] Communative Matrix Multiplcation
    >> 
    >> 
    >> On 14-08-2012, at 19:26, Doran, Harold wrote:
    >> 
    >> >
    >> > I'm not seeing why the following occurs:
    >> >
    >>  > T1 <- (A1 - A2) %*% D 
    >>  > T2 <- (A1 %*% D) - (A2 %*% D)
    >>  > identical(T1, T2) 
    >>  [1] FALSE 
    >>



More information about the R-help mailing list