[R] Maximally independent variables
Charles C. Berry
cberry at tajo.ucsd.edu
Wed Mar 1 22:35:47 CET 2006
Gabor Grothendieck <ggrothendieck <at> gmail.com> writes:
>
> That's basically what I already do but what I was wondering
> was if there were any other approaches such as connections
> with clustering, PCA, that have already been developed in
> R that might be applicable.
Have you considered finding the combination with maximum generalized variance of
three scaled variables (i.e. the maximum determinant of the correlation matrix
of three variables)?
You can vectorize this calculation as follows:
z <- combinations(ncol(DF), 3)
cormat <- cor(DF)
det3 <- function(ra,rb,rc) 1 - ra*ra - rb*rb - rc*rc + 2*ra*rb*rc
res <- det3( cormat[z[,1:2]],cormat[z[,c(1,3)]],cormat[z[,c(2,3)]] )
z[which.max(res),]
>
> On 3/1/06, Jacques VESLOT <jacques.veslot <at> cirad.fr> wrote:
> > library(gtools)
> > z <- combinations(ncol(DF), 3)
> > maxcor <- function(x) max(as.vector(as.dist(cor(DF[,x]))))
> > names(DF)[z[which.min(apply(z, 1, maxcor)),]]
> >
> >
> > Gabor Grothendieck a écrit :
> >
> > >Are there any R packages that relate to the
> > >following data reduction problem fo finding
> > >maximally independent variables?
> > >
[rest deleted]
More information about the R-help
mailing list