Revision 88232618987bd241ef9d0059a493a74106c64e69 authored by Douglas Bates on 09 September 2005, 00:00:00 UTC, committed by Gabor Csardi on 09 September 2005, 00:00:00 UTC
1 parent 1a5ec6a
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