1
$\begingroup$

I am trying to visualize a 2D Gaussian for personal purposes. i.e this formula for the 2D case:

$$f(\mathbf x\mid \Theta_i)=|2\pi \Sigma_i|^{-\frac12}e^{-\frac12(\mathbf x-\mu_i)^T\Sigma_i^{-1}(\mathbf x-\mu_i)}$$

I coded it in python and if I input the covariance matrix:

\begin{bmatrix} 1 & 0.9\\ 0.9 & 1 \end{bmatrix}

I get the following:

enter image description here

Which makes perfect sense, as I expected to see some form of ellipse like shapes.

However if I input the matrix:

\begin{bmatrix} 1 & 1.1\\ 1.1 & 1 \end{bmatrix}

I get this:

enter image description here

Which looks a bit like a saddle point.

In general, when I set the covariance matrix to be such that $\operatorname{cov}(x,y) > \operatorname{cov}(x,x) = \operatorname{cov}(y,y)$ I get the second case, which in my head isn't a valid Gaussian. Thus I suspect I have broken some property, but I can't understand why it isn't possible for the covariance of $(x,y)$ to be larger than than the covariance of $(x,x)$.

$\endgroup$

2 Answers 2

4
$\begingroup$

This is a consequence of the famous Cauchy-Scwhartz Inequality, which is used to prove that correlations are bounded by 1. This implies that $$ Cov(X,Y) \leq \sqrt{Var(X)Var(Y)} $$

$\endgroup$
1
  • $\begingroup$ You are missing the absolute value notation on your answer $\endgroup$
    – Makogan
    Commented Apr 14, 2020 at 19:43
2
$\begingroup$

For two r.v. $X$ and $Y$, a theorem in probability says $$|\text{cov}(X,Y)|\le \sigma_X\sigma_Y$$or equivalently $$|E\{\bar X\bar Y\}|^2\le E\{\bar X^2\}E\{\bar Y^2\}$$with $\bar X=X-E\{X\}$ and $\bar Y=Y-E\{Y\}$. This is an interpretation of Cauchy-Schwarz inequality in probability. Based on this, a correlation coefficient $\rho$ is defined as $$\rho={\text{cov}(X,Y)\over \sigma_X\sigma_Y}$$with $$|\rho|\le 1$$so, we can say that you have broken the Cauchy-Schwarz inequality, or equivalently, the positive definiteness of the covariance matrix.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .