Maxima Function
cov (matrix)
The covariance matrix of the multivariate sample, defined as
n ==== 1 \ _ _ S = - > (X - X) (X - X)' n / j j ==== j = 1
X_j is the j-th row of the sample matrix.
Example:
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s2 : read_matrix (file_search ("wind.data"))$ (%i4) fpprintprec : 7$ /* change precision for pretty output */ (%i5) cov (s2); [ 17.22191 13.61811 14.37217 19.39624 15.42162 ] [ ] [ 13.61811 14.98774 13.30448 15.15834 14.9711 ] [ ] (%o5) [ 14.37217 13.30448 15.47573 17.32544 16.18171 ] [ ] [ 19.39624 15.15834 17.32544 32.17651 20.44685 ] [ ] [ 15.42162 14.9711 16.18171 20.44685 24.42308 ]