Hi,

I'd like to store large covariance matrices using Matrix classes.

dsyMatrix seems like the right one, but I want to specify just the
upper/lower triangle and diagonal and not have to instantiate a huge
n^2 vector just for the sake of having half of it ignored:

Dumb example:
M <- new("dsyMatrix", uplo="U", x=rnorm(1e4), Dim=as.integer(c(100, 100)))
diag(M) <- 1

This doesn't work:
M <- new("dsyMatrix", uplo="U", x=0, Dim=as.integer(c(100, 100)))
Error in validObject(.Object) :
  invalid class "dsyMatrix" object: length of x slot != prod(Dim)

Is there an easier way of doing this?

Thanks,
Gad

-- 
Gad Abraham
PhD Student, Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabra...@csse.unimelb.edu.au
web: http://www.csse.unimelb.edu.au/~gabraham

______________________________________________
R-help@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.

Reply via email to