Returns the empirical covariance matrix of x and y.
C = nisp_cov ( x , y )
a n-by-1 matrix of doubles
a n-by-1 matrix of doubles
a 2-by-2 matrix of doubles, the empirical covariance
Returns the empirical covariance matrix, normalized by n-1, where n is the number of observations. TODO : add the normalization by n TODO : add the C=cov(x) calling sequence
x = [1;2]; y = [3;4]; C = nisp_cov (x,y) expected = [0.5,0.5;0.5,0.5] x = [230;181;165;150;97;192;181;189;172;170]; y = [125;99;97;115;120;100;80;90;95;125]; expected = [1152.4556,-88.911111;-88.911111,244.26667] C = nisp_cov (x,y)
"Introduction to probability and statistics for engineers and scientists.", Sheldon Ross