티스토리 뷰

From matlab document:

cov(x) or cov(x,y) normalizes by N-1, if N>1, where N is the number of observations. This makes cov(X) the best unbiased estimate of the covariance matrix if the observations are from a normal distribution. For N=1, cov normalizes by N.

::cvCalcCovarMatrix( (const CvArr**) &src, 1, opencvcov, NULL, CV_COVAR_ROWS | CV_COVAR_NORMAL );
matlabcov = cov(x);

note: size(x) == [7,100]

7 observations and 100 dimentional features then,

opencvcov : 1st row - 14910766 –6950127 222429.4 896977.6 …

matlabcov : 1st row - 2130110 –992875 31775.63 128139.6 234368.9 -79741.8 …

opencvcov / matlabcov = 6.999998 7.000001 7 7.000003

in floatpoint numbers

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크