Covarianace Cov(x,y)=E[(xE[x])(YE[y]) where E[x] is

Covarianace
Cov(x,y)=E[(x-E[x])(Y-E[y]) where E[x] is expected mean of X and E[Y] is expected mean of y
Sigma in source code
Third algorithm is expected product of X point – Ux (average of all x points) *( Y – average of all y points)
All from Bionic Turtle
Correlation
rho (correlation coefficient)
StandardDev of X is
volatility of X
Results in
e.g.
Always in portfolio theory for quant finance
Covariance=.67
From http://www.youtube.com/watch?v=35NWFr53cgA
Another sample from :
Cov(x,y)=E[(x-E[x])(Y-E[y]) where E[x] is expected mean of X and E[Y] is expected mean of y
e.g.
x=1 E[x]=0
y=3 E[y]=4
cov(x,y)=E[(x-E[x])(y-E[y])=(1-0)*(3-4)=1*-1