covariance(x, y [, mode, weights=w],
/sample, /population, /keepdims, /double, /omitnans])
By default, this function returns the sample covariance of numerical
y, which must have the same
number of elements.
mode is a scalar or an array with a size different
from that of
x, then it indicates the dimension(s) along
which covariances are calculated for each combination of the remaining
coordinates. In that case, if also
/keepdims is specified,
then the dimension(s) along which the covariances are calculated are
set to 1 in the result. If
/keepdims is not set, then such
dimensions are omitted from the result, and if only a single number is
returned, then it is returned as a scalar.
mode is an array with the same number of elements as
x, then each element of
mode identifies the
(scalar) class to which each corresponding element of
y belong, and then a covariance is returned for each
class. The first element of the result refers to class
no class is negative), or to the most negative class.
weights is specified, then it must be a numerical
array with the same dimensions as
(or merely the same number of elements, if covariances are calculated
by class), and then each of its elements indicates the weight of the
corresponding elements of
y, and then
weighted covariances are returned. The
copied to a version with the same data type as
x for the
internal calculations (except that the copy is kept real even if
x is complex).
weights are specified, then
population covariances are returned. Otherwise, sample covariances
/omitnans is specified, then data elements and weights that
are equal to NaN are omitted from the calculations.
Complex numbers are supported.
The result has type
cdouble, or if
specified. Otherwise, the result has type
See also: sdev, variance