Re: [R] symmetric matrix multiplication

2011-10-23 Thread statfan
Thank you Dan and Ted for these helpful comments. I will implement this simple force symmetry code you suggested and make sure I familiarize with this floating-point calculation problem so I can recognize such issues in the future. -- View this message in context: http://r.789695.n4.nabble.com/sy

Re: [R] symmetric matrix multiplication

2011-10-23 Thread Ted Harding
On 23-Oct-11 07:00:07, Daniel Nordlund wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] >> On Behalf Of statfan >> Sent: Saturday, October 22, 2011 10:45 PM >> To: r-help@r-project.

Re: [R] symmetric matrix multiplication

2011-10-23 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of statfan > Sent: Saturday, October 22, 2011 10:45 PM > To: r-help@r-project.org > Subject: [R] symmetric matrix multiplication > > I have a symmetric

[R] symmetric matrix multiplication

2011-10-22 Thread statfan
I have a symmetric matrix B (17x17), and a (17x17) square matrix A. If do the following matrix multiplication I SHOULD get a symmetric matrix, however i don't. The computation required is: C = t(A)%*%B%*%A here are some checks for symmetry > (max(abs(B - t(B [1] 0 > C = t(A)%*%B%*%A > (max(