COV-1D

Compute 1-dimensional covariance in Matlab
Download

COV-1D Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Luigi Rosa
  • Operating Systems:
  • Windows All
  • File Size:
  • 3 KB

COV-1D Tags


COV-1D Description

A handy Matlab Add-in that allows you to calculate 1-dimanesional covariance. Copy cov_1d.c in matlab current directory mex compile this file: mex cov_1d.c To call this function: cov_1d(a) returns the variance of the vector elements normalizes by (N-1) where N is the number of observations cov_1d(a,0) returns the variance of the vector elements normalizes by (N-1) where N is the number of observations cov_1d(a,1) returns the variance of the vector elements normalizes by (N) where N is the number of observations cov_1d(a,b) a and b are monodimensional vectors with the same size N. It returns E where aa=E and ba=E E is the mathematical expectation normalizes by (N-1) where N is the number of observations cov_1d(a,b,0) a and b are monodimensional vectors with the same size N. It returns E where aa=E and ba=E E is the mathematical expectation normalizes by (N-1) where N is the number of observations cov_1d(a,b,1) a and b are monodimensional vectors with the same size N. It returns E where aa=E and ba=E E is the mathematical expectationnormalizes by (N) where N is the number of observations NOTE: a and b must be REAL vectors (i.e. monodimensional) From these relationships it follows that: cov_1d(a,a)=cov_1d(a)=cov_1d(a,a,0) cov_1d(a,a,1)=cov_1d(a,1) sqrt(std(a)) is the standard deviation of vector a (normalized to N-1) sqrt(std(a,1)) is the standard deviation of vector a (normalizaed to N) cov_1d is faster than matlab cov function and can be also used to compute std of 1-dimensional vector.


COV-1D Related Software