Additional output in cancor
Oh, great timing! R went into feature-freeze last night for 1.3.0. No new features until 1.4.0 in December or whatever comes next.
On Mon, 11 Jun 2001, Jonathan Rougier wrote:
Can I suggest an additional output component in cancor, from package
mva? It would be useful to have the number of canonical correlation
vectors, equivalently the rank of the covariance between x and y (label
"rank"). This would usually be min(dx, dy), where dx and dy have
already been computed for the svd function, but there might be
situations where it was less than this, so I guess the safe option would
be to include
rank = qr(t(x) %*% y)$rank
among the outputs. Then the last four lines of the help might be
amended to
rk <- cxy$rank
all.equal(cor(x %*% cxy$xcoef[, 1:rk, drop=FALSE],
y %*% cxy$ycoef[, 1:rk, drop=FALSE]), diag(cxy$cor))
all.equal(cor(x %*% cxy$xcoef[, 1:rk, drop=FALSE]), diag(1, rk))
all.equal(cor(y %*% cxy$ycoef[, 1:rk, drop=FALSE]), diag(1, rk))
which I think is more intuitive.
More radically, the xcoef and ycoef components of cancor might
themselves be restricted to the appropriate columns (1:rank). This
might affect some existing code, although any code that uses the
non-informative columns has got to be broken, hasn't it?!
Nope. It's rare, but needing to span the orthocomplement can happen.
Can I also suggest an extra reference for the help page: Mardia, K. V., J. T. Kent and J. M. Bibby (1979). Multivariate Analysis, London, Academic Press Ltd, ch. 10.
I'd say that was inferior to Seber (and I find it rather confusing). Your mileage may vary....
Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._