0
$\begingroup$

I am trying to replicate some results from this well-cited paper evaluating various methods to determine the rank of a matrix. They give several covariance matrices, and then sample from a Gaussian distribution with each of these matrices.

However, I get strange results when I try to use one of these covariance matrices. In particular, I am trying to sample from a multivariate Gaussian with the first matrix in Figure 1, but when I do so, every variable is exactly the same!

Here is Matlab code:

c = 0.8;
C = [c c c c 0 0 0 0 0;
    c c c c 0  0 0 0 0;
    c c c c 0  0 0 0 0;
    c c c c 0  0 0 0 0;
    0 0 0 0 c  c c 0 0;
    0 0 0 0 c  c c 0 0;
    0 0 0 0 c  c c 0 0;
    0 0 0 0 0  0 0 c c;
    0 0 0 0 0  0 0 c c;]
X = mvnrnd(zeros(1,9), C,10)

Which gives

X =

    1.0310    1.0310    1.0310    1.0310    0.1740    0.1740    0.1740    1.2928    1.2928
    0.3512    0.3512    0.3512    0.3512   -2.0864   -2.0864   -2.0864    0.0000    0.0000
    0.7149    0.7149    0.7149    0.7149   -0.5316   -0.5316   -0.5316    2.5462    2.5462
   -1.7125   -1.7125   -1.7125   -1.7125    0.9807    0.9807    0.9807   -0.3451   -0.3451
   -0.5237   -0.5237   -0.5237   -0.5237   -0.1748   -0.1748   -0.1748    0.1343    0.1343
    0.0530    0.0530    0.0530    0.0530   -1.7133   -1.7133   -1.7133   -0.2837   -0.2837
   -0.5293   -0.5293   -0.5293   -0.5293   -0.6427   -0.6427   -0.6427   -0.1456   -0.1456
   -2.1785   -2.1785   -2.1785   -2.1785   -1.9042   -1.9042   -1.9042    0.7329    0.7329
    1.6811    1.6811    1.6811    1.6811    2.4141    2.4141    2.4141    0.0731    0.0731
   -0.1646   -0.1646   -0.1646   -0.1646    1.2982    1.2982    1.2982    1.7498    1.7498

Why is every variable the same? Note that if I add the identity matrix to $C$, this is no longer the case. But I don't think the problem is that $C$ is not positive definite; all of its eigenvalues are non-negative.

$\endgroup$
  • $\begingroup$ Please explain the sense in which "every variable is the same:" I see three distinct column values in $X,$ exactly as would be expected from the covariance matrix. $\endgroup$ – whuber Jan 13 at 22:52
  • $\begingroup$ @whuber My bad...I meant within each block. For example, why are the first three columns exactly the same? Shouldn't they be correlated but not exactly the same? I suppose I am expecting this because the covariance is 0.8 and not 1, but perhaps I am confusing it with correlation. How could you tell from that covariance matrix that the variables in each group would be exactly the same? $\endgroup$ – The_Anomaly Jan 13 at 23:02
  • 1
    $\begingroup$ You seem to confusing correlation with covariance. The correlation matrices for each block are all $1$s: everything must be perfectly correlated, whence all values within a block must be constant positive multiples of each other. Because all covariances are the same, that positive multiple must be $1.$ $\endgroup$ – whuber Jan 13 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.