Skip to content
Prev 2725 / 12125 Next

[R-pkg-devel] mvrnorm, eigen, tests, and R CMD check

But why would you want to tie your tests to specific platforms, if
mathematically all those results are equivalent?  You could compare the
orthogonal complements from a full rank matrix (say the identity) to each
expected eigenspace.  E.g., for the example I gave above, where e2 and e1
gave different basis for 2 eigenspaces:
+   residuals(lm.fit(y=diag(5), e1$vectors[,1,drop=FALSE])),
+   residuals(lm.fit(y=diag(5), e2$vectors[,1,drop=FALSE])))
[1] "Mean relative difference: 4.791489e-16"
+   residuals(lm.fit(y=diag(5), e1$vectors[,2:3,drop=FALSE])),
+   residuals(lm.fit(y=diag(5), e2$vectors[,2:3,drop=FALSE])))
[1] "Mean relative difference: 1.469377e-15"
+   residuals(lm.fit(y=diag(5), e1$vectors[,4:5,drop=FALSE])),
+   residuals(lm.fit(y=diag(5), e2$vectors[,4:5,drop=FALSE])))
[1] TRUE


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, May 17, 2018 at 12:55 PM, Ben Bolker <bbolker at gmail.com> wrote: