Every working mathematician knows that if one does not control oneself (best of all by examples), then after some ten pages half of all the signs in formulae will be wrong and twos will find their way from denominators into numerators. V.I. Arnold, “On Teaching Mathematics”.

i keep losing track of factors of N-1 in my head, so maybe you do too. to be specific, my recollection is that if the design matrix X contains standardized data, then the correlation matrix is

.

but another voice asks, didn’t an N-1 in the numerator cancel an N-1 in the denominator? i’m dividing covariances by two standard deviations.

let’s take a look. we are going to use something closer to standard notation for a little while, rather than the notations i’ve been using. so, for the definitions that follow, forget about my usual conventions for X and Z.

we start with a data matrix , with variables in columns. we compute the mean of each column,

.

we subtract each column mean from the entries in that column, and denote the resulting deviate by (LC) x:

.

that is called centered data or zero-mean data.

the sample variance of raw data or of centered data is

where we recall that N-1 rather than N appears because it gives us an unbiased estimate of the population variance. the square root, , of the sample variance is the sample standard deviation. to get the sample variance of raw data, just center it first.

we can create standardized variables, also called standard deviates, from centered data by dividing each column entry by the standard deviation of that column; denote these by (LC) z, and we have

.

we can also create what are called small standard deviates by dividing standard deviates by , getting:

.

the sample covariance between the jth and kth zero-mean variables is

.

(for j = k, this is the sample variance.)

i remark that i have used the usual notation s instead of , which would be consistent with the notation for the sample variance. the sample correlation coefficient between the ith and kth variables is their sample covariance divided by their standard deviations:

.

(there, didn’t that just eliminate an N-1? well, no.)

now let’s start relating all that to matrices. the first one we care about is the matrix x of centered data. the sample variance and covariance can be combined in matrix form as

.

that is, for any centered data x, the product is (N-1) times the covariance matrix of the raw data. the key is that the summation

is exactly .

now, let’s return to my usual notation.

if you need to, i encourage you to do the following calculations in fact, but perhaps it suffices to do them in principle. for the davis example, we already have the raw data D and the zero-mean data X. go ahead and compute standardized data Z and small standard deviates

for each of those four matrices of data M = {D, X, Z, Y}, compute three things:

,

the covariance matrix cov(M),

and the correlation matrix corr(M).

what will we find?

first, two of the 4 covariance matrices are the same, for the raw data D and the zero-mean data X:

cov(D) = cov(X).

second, all four correlation matrices are the same; the correlation matrix is unique:

corr(D) = corr(X) = corr(Z) = corr(Y).

third, the covariance matrix of the standardized data is also its correlation matrix, hence is the common correlation matrix:

cov(Z) = corr(Z).

now what about ?

for three of the four data matrices, all except D which is not zero-mean, we must have

.

in particular, for standardized data Z, the correlation matrix is also proportional to , because it is also the covariance matrix:

.

finally, the definition of small standard deviates says

so

.

in conclusion, introducing small standard deviates Y lets us use the unique correlation matrix indirectly, by computing either an eigendecomposition of or an SVD of Y. the eigenvalues, as well as the eigenvectors, of are precisely the eigenvalues and the eigenvectors of the correlation matrix.

perhaps i should remind you that

.

small standard deviates would let us use Y instead of the correlation matrix; they do nothing for any of the other covariance matrices.

for any other data matrix, cov(M) and have the same eigenvectors but their eigenvalues differ by a factor N-1.

i hate to say the following, but i want to move on. when i think of the correlation matrix as the covariance matrix of standardized data – which

has standard deviations equal to 1 – i know there’s a factor of N-1. my brain takes two premises and reaches a conclusion:

corr(Z) = cov(Z),

and

,

hence

.

but when i think of the correlation matrix as

,

i still can’t see why there’s an N-1. someday i’ll track it down and beat it to death, but not today. i suspect i’ll be embarrased, but that’s not all that important.

Advertisements
(function(g,$){if("undefined"!=typeof g.__ATA){
g.__ATA.initAd({collapseEmpty:'after', sectionId:26942, width:300, height:250});
g.__ATA.initAd({collapseEmpty:'after', sectionId:114160, width:300, height:250});
}})(window,jQuery);
var o = document.getElementById('crt-1498923541');
if ("undefined"!=typeof Criteo) {
var p = o.parentNode;
p.style.setProperty('display', 'inline-block', 'important');
o.style.setProperty('display', 'block', 'important');
Criteo.DisplayAcceptableAdIfAdblocked({zoneid:388248,containerid:"crt-1498923541",collapseContainerIfNotAdblocked:true,"callifnotadblocked": function () {var o = document.getElementById('crt-1498923541'); o.style.setProperty('display','none','important');o.style.setProperty('visbility','hidden','important'); }
});
} else {
o.style.setProperty('display', 'none', 'important');
o.style.setProperty('visibility', 'hidden', 'important');
}

## Leave a Reply

Fill in your details below or click an icon to log in:

You are commenting using your WordPress.com account. ( Log Out / Change )

You are commenting using your Twitter account. ( Log Out / Change )

You are commenting using your Facebook account. ( Log Out / Change )

You are commenting using your Google+ account. ( Log Out / Change )

Connecting to %s