Re: Efficient construction of a correlation matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg98553] Re: Efficient construction of a correlation matrix
- From: google at dantimatter.com
- Date: Sun, 12 Apr 2009 03:49:14 -0400 (EDT)
- References: <grkgl2$69m$1@smc.vnet.net> <grpih7$lpk$1@smc.vnet.net>
thanks everyone!
dan
On Apr 11, 3:57 am, Ray Koopman <koop... at sfu.ca> wrote:
> On Apr 9, 2:54 am,dantimatter<goo... at dantimatter.com> wrote:
>
> > Hello all,
>
> > This was a question that was asked back in 2003 that didn't seem
> > to have a response: is there a fast way to generate a matrix of
> > correlation coefficients given a list of vectors? I have about
> > fifty vectors that are each around 1300 elements long and I'd like
> > to correlate them with each other to get a 50x50 matrix. I know
> > that I can do this with loops or tables but I thought that perhaps
> > there exists a fast and computationally inexpensive way to do this.
> > Any thoughts?
>
> > Many thanks,
> > Dan
>
> If you're using 6 or 7, Correlation[data]
> will give you the 50 x 50 correlation matrix.
>
> If you're pre-6, <<Statistics`MultiDescriptiveStatistics`
> will load a standard add-on package, and CorrelationMatrix[data]
> will give you the correlation matrix.
>
> In both cases, the dimensions of the data matrix must be
> {#_of_cases, #_of_variables}, so transpose as necessary.