Revision 19f0062d379d9a43a18a1dc7ddacd12c535fc08d authored by Douglas Bates on 04 July 2005, 00:00:00 UTC, committed by Gabor Csardi on 04 July 2005, 00:00:00 UTC
1 parent a3ce55b
Raw File
pdmatrix.R
setAs("matrix", "pdmatrix",
      function(from) new("pdmatrix", from))

# setAs("pdfactor", "pdmatrix",
#       function(from) new("pdmatrix", crossprod(from)))

# setAs("pdmatrix", "pdfactor",
#       function(from) {
#           val <- new("pdfactor", .Call("nlme_Chol", from))
#           val@logDet <- sum(log(diag(val)))
#           val
#       },
#       function(from, value) {
#           as(from, "pdmatrix") <- crossprod(value)
#           from
#       })

setAs("pdmatrix", "corrmatrix",
      function(from) {
          ss = sqrt(diag(from))
          new("corrmatrix", t(from/ss)/ss, stdDev = ss)
      })
back to top