If x is a matrix and vec is not given, then each column is treated as a separate sample. Otherwise vec has to have as many elements as x has columns and values starting from 1 up to the number of 'variables', e.g. if x is an N by 5 matrix and vec = c(1,2,1,3,1) then the multivariance of the 1-dimensional variables represented by column 2 and 4 and the 3-dimensional variable represented by the columns 1,3,5 is computed.
As default it computes the normalized Nscaled squared multivariance, for a multivariance without normalization the argument normalize = FALSE has to be passed to cdms.
correlation = TRUE yields values between 0 and 1. These can be interpreted similarly to classical correlations, see also multicorrelation.
As a rough guide to interpret the value of distance multivariance note:
If the random variables are not (n-1)-independent, large values indicate dependence, but small values are meaningless. Thus in this case use total.multivariance.
If the random variables are (n-1)-independent and Nscale = TRUE, values close to 1 and smaller indicate independence, larger values indicate dependence. In fact, in the case of independence the test statistic is a Gaussian quadratic form with expectation 1 and samples of it can be generated by resample.multivariance.
If the random variables are (n-1)-independent and Nscale = FALSE, small values (close to 0) indicate independence, larger values indicate dependence.
Finally note, that due to numerical (in)precision the value of multivariance might become negative. In these cases it is set to 0. A warning is issued, if the value is negative and further than the usual (used by all.equal) tolerance away from 0.