= Negative covariance
{title2=$\operatorname{Cov}(X,Y)<0$}
Two <random variables> have \b[negative covariance] when $\mathbb E[(X-\mathbb EX)(Y-\mathbb EY)]<0$, assuming finite <second moments>. Opposite deviations from their respective <expected values> then outweigh matching deviations on average. For example, if $Y=c-X$ for a constant $c$, the bilinear identities of <covariance> give $\operatorname{Cov}(X,Y)=-\operatorname{Var}(X)$, which is strictly negative when $X$ has positive <variance>.<Covariance and Correlation by Jeremy Orloff and Jonathan Bloom>[§2.1, scaling and covariance with oneself]{ref}
<Sampling without replacement> gives a useful example in which the negative sign comes from a shared finite resource. Choose a <simple random sample> $S$ of exactly $k$ distinct members from a <statistical population> of size $N$, with $0<k<N$. For each member define the <inclusion indicator> $I_i=\mathbf1_{\{i\in S\}}$. Its <inclusion probability> is $p=k/N$. For different members $i,j$, the <joint inclusion probability> is
$$
\mathbb E[I_iI_j]=\mathbb P(i,j\in S)
=\frac{k}{N}\frac{k-1}{N-1}.
$$
Subtracting the product of the <expected values> gives
$$
\boxed{\operatorname{Cov}(I_i,I_j)
=-\frac{p(1-p)}{N-1}<0,\qquad
\operatorname{Corr}(I_i,I_j)=-\frac1{N-1}.}
$$
The <Pearson correlation coefficient> follows because each <inclusion indicator> has <variance> $p(1-p)$. Once member $i$ is included, only $k-1$ places remain for the other $N-1$ members, reducing member $j$'s <conditional probability> of inclusion below $k/N$.
For an original exact example, draw two members from four. The six unordered sample pairs are equiprobable. For $I_1,I_2$, the outcomes $(0,0)$ and $(1,1)$ each have <probability> $1/6$, while $(0,1)$ and $(1,0)$ each have <probability> $1/3$. Hence $\operatorname{Cov}(I_1,I_2)=1/6-1/4=-1/12$, and their <Pearson correlation coefficient> is $-1/3$. Matching outcomes remain possible despite the <negative covariance>.
\Image[/negative-covariance-fixed-size-sampling.png]
{title=<Negative covariance> between two <inclusion indicators> in a two-of-four sample}
{description=Original exact enumeration of all six equiprobable unordered sample pairs. The table gives the joint probabilities of the two inclusion indicators; the sample list shows which outcomes contribute to each cell.}
A fixed total alone does not force every pair among three or more <random variables> to have <negative covariance>. If $\sum_jX_j=c$, then
$$
\sum_{j\ne i}\operatorname{Cov}(X_i,X_j)=-\operatorname{Var}(X_i).
$$
This constrains the sum of the off-diagonal entries in a row of the <covariance matrix>. It does not fix each entry's sign. For a counterexample, let $Z$ be equally likely to be zero or one, and set $X_1=Z$, $X_2=Z$, $X_3=2-2Z$. Their total is always two, yet $\operatorname{Cov}(X_1,X_2)=\operatorname{Var}(Z)=1/4>0$.
In the <simple random sample>, <exchangeability> makes the off-diagonal <covariances> equal, so the fixed-total identity does determine each of them: $(N-1)\operatorname{Cov}(I_i,I_j)=-p(1-p)$. The same distinction between a linear constraint and individual pair signs matters for the <joint dependence of leave-one-out consensus residuals>.
Back to article page