SCM

SCM Repository

[matrix] View of /pkg/tests/group-methods.R
ViewVC logotype

View of /pkg/tests/group-methods.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 573 - (download) (annotate)
Sat Feb 26 18:06:08 2005 UTC (14 years, 4 months ago) by maechler
File size: 484 byte(s)
more group methods and testing them
### Testing the group methods

library(Matrix)
set.seed(2001)

mm <- Matrix(rnorm(50 * 7), nc = 7)
xpx <- crossprod(mm)# -> "factors" in mm !
round(xpx, 3) # works via "Math2"

y <- rnorm(nrow(mm))
xpy <- crossprod(mm, y)
res <- solve(xpx, xpy)
signif(res, 4) # 7 x 1 Matrix

## exp(): component wise
signif(dd <- (expm(xpx) - exp(xpx)) / 1e34, 3)# 7 x 7

stopifnot(validObject(xpx),
          validObject(xpy),
          validObject(dd))

proc.time() # for ``statistical reasons''



root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge