Library: | xplore |
See also: | cov var |
Quantlet: | corr | |
Description: | computes the (Bravais-Pearson) correlation matrix of a given array |
Usage: | r = corr(x) | |
Input: | ||
x | n x p x d1 x ... x dn array | |
Output: | ||
r | p x p x d1 x ... x dn array, the p x p correlation matrices |
library("xplore") randomize(0) x = normal(200, 3, 2) corr(x)
Contents of r [,,1,1,1,1,1,1] [1,] 1 0.031623 -0.045468 [2,] 0.031623 1 0.050513 [3,] -0.045468 0.050513 1 [,,2,1,1,1,1,1] [1,] 1 0.029059 -0.07081 [2,] 0.029059 1 0.13138 [3,] -0.07081 0.13138 1