x cov y cov[x;y]
Where x and y are conforming
numeric lists returns their covariance as a
floating-point number. Applies to all numeric data types and signals an error with temporal types, char and sym.
q)2 3 5 7 cov 3 3 5 9
4.5
q)2 3 5 7 cov 4 3 0 2
-1.8125
q)select price cov size by sym from trade
cov is an aggregate function.
The function cov is equivalent to {avg[x*y]-avg[x]*avg y}.