Covariance calculations and correlations
Code: "stat_corr.m"
Programming language: Octave
DMelt Version 1. Last modified: 05/08/2015. License: Free
http://jwork.org/dmelt/code/cache/stat_corr_7514.m
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



v1=[1,10,20,2,4,7,4,3]
v2=[3,11,10,3,5,5,7,3]
a=cov(v1,v2);           printf('Covariance=%f\n',a)
a=correlation(v1,v2);   printf('Coeff. correlation=%f\n',a)