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}.
% @iftex
% @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
% @end iftex
% If called with one argument, compute @code{cov (@var{x}, @var{x})}.
% @end deftypefn

## CROSS-REFERENCE INFORMATION

This function calls:
• center % If @var{x} is a vector, subtract its mean.
This function is called by:
• cor % Compute correlation.
• corrcoef % Compute correlation.

Generated on Sat 16-May-2009 00:04:49 by m2html © 2003