vcms, vcxs#
Purpose#
Computes the observed variance-covariance matrix.
Format#
Remarks#
The variance covariance matrix is that of the input data matrix. It is
computed as the moment matrix of deviations about the mean divided by
the number of observations \(N\). For an unbiased estimator covariance
matrix which uses \(N - 1\) rather than \(N\) see vcm() or vcx().
Examples#
// Compute observed variance-covariance matrix from data
x = rndn(100, 3);
vc = vcxs(x);
print vc;
// Compute from a moment matrix (constant term must be first column)
x = rndn(100, 3);
m = (ones(100, 1) ~ x)'(ones(100, 1) ~ x);
vc = vcms(m);
print vc;
Source#
corrs.src