Skip to content
Prev 326711 / 398502 Next

Sparse matrix no longer sparse (Matrix Package)

This is a terrible example as I didn't realize my code actually does create a non-symmetric matrix and in this case the function behaves as expected. Nonetheless, my original issue stands and that issue still does not make sense. 

Apologies for bad example code.

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Doran, Harold
Sent: Thursday, July 11, 2013 11:36 AM
To: 'John Kane'; r-help at r-project.org
Cc: dmbates at gmail.com; maechler at stat.math.ethz.ch
Subject: Re: [R] Sparse matrix no longer sparse (Matrix Package)

Thank you, John. I originally used dput() but the output is huge. However, here is a reproducible example of what I think very unexpected behavior of some matrix functions.
Error in Cholesky(as(A, "symmetricMatrix"), perm = perm, LDL = LDL, super = super,  : 
  error in evaluating the argument 'A' in selecting a method for function 'Cholesky': Error in asMethod(object) : 
  not a symmetric matrix; consider forceSymmetric() or symmpart()

### For fun try this
Error in asMethod(object) : 
  not a symmetric matrix; consider forceSymmetric() or symmpart()

### This does indeed work, but should I need to implement this step?

Cholesky(forceSymmetric(A %*% D))

So, there is something about changing the elements of a ddi matrix that causes subsequent problems. Is there a good reason this occurs and something I should be doing differently, or is this a bug?

Thanks

-----Original Message-----
From: John Kane [mailto:jrkrideau at inbox.com]
Sent: Thursday, July 11, 2013 10:57 AM
To: Doran, Harold; r-help at r-project.org
Subject: RE: [R] Sparse matrix no longer sparse (Matrix Package)

The message got through but not the attachment. The R help list tends to strip off attachements for security reasons.  Files of types  txt, png, & pdf should get through.

In most cases the accepted method of sending data is to use the dput() function to output a file in the console and then copy and paste the results into your email.

So for file "dat1" one would just use dput(dat1) and paste the results into an email. 

John Kane
Kingston ON Canada
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.