Home > freetb4matlab > statistics > base > cov.m

cov

PURPOSE ^

% Compute covariance.

SYNOPSIS ^

function c = cov (x, y)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} cov (@var{x}, @var{y})
% Compute covariance.
%
% If each row of @var{x} and @var{y} is an observation and each column is
% a variable, the (@var{i}, @var{j})-th entry of
% @code{cov (@var{x}, @var{y})} is the covariance between the @var{i}-th
% variable in @var{x} and the @var{j}-th variable in @var{y}.
% @tex
% $$
% \sigma_{ij} = {1 \over N-1} \sum_{i=1}^N (x_i - \bar{x})(y_i - \bar{y})
% $$
% where $\bar{x}$ and $\bar{y}$ are the mean values of $x$ and $y$.
% @end tex
% If called with one argument, compute @code{cov (@var{x}, @var{x})}.
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003