The chol and solve methods for dpoMatrix (Matrix package) are much
faster than the default methods. But, the time required to coerce a
regular matrix to dpoMatrix swamps the advantage.

Hence, I have the following problem, where use of dpoMatrix is worse
than a regular matrix.

library(Matrix)

x <- diag(10)

system.time(
  for(r in seq(0.1, 0.9, length.out=1000)) {
    m <- r^abs(row(x)-col(x));
    chol(m); solve(m);
  })

system.time(
  for(r in seq(0.1, 0.9, length.out=1000)) {
    M <- as(r^abs(row(x)-col(x)), 'dpoMatrix')
    chol(M); solve(M);
  })

Any ideas?

______________________________________________
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