statistic formula questions

Few questions on formulas for statistics:

  1. What is the formula for the covariance of two random variables, I see different formulas online, but I know expected value is involved in the formula

  2. Can someone explain to me how chebyshev’s inequality (formula) works with an example?

Regarding the first question:

Cov(X,Y)=1/n sum (X-E(X))*(Y-E(Y))

Regarding your 2nd question, below is an example where you can apply the formula:

Of the 25 international mutual funds that exist, a reporting agency has reported that the mean return was 12% and the standard deviation was 9%. What minimum percentage of the observations should fall within 1.5 standard deviations on either side of the mean?

1-1/(1.5)²=55.6%

Chebyshev’s Inequality states that the proportion of obervations within k standard deviations of the arithmetic mean is at least 1-1/k² for all k>1. Thus in the above example, 55.6% of the observations will fall within 1.5 standard deviations.

To be clear: this is the formula for the covariance of two _ populations _.

The covariance of two _ samples _ would have (n − 1) in the denominator, not n.

Thank you S2000, I forgot to point that out.

I tell my students that covariance and variance are really the same calculation - they’re both an expected deviation from the mean. In Tartaglia’s example, if (X-E(X)) is X’s deviation and (Y-E(Y)) is Y’s deviation,

  • the variance is the expected SQUARED DEVIATION from the mean for ONE random variable. in other words, the variance of X is the expected value of [(X-E(X))^2], and the variance of Y is the expected value of [(Y-E(Y))^2]
  • the covariance is the expected CROSS DEVIATION from the means for TWO variables. So, the covariance of X and Y is the expected value of [X-E(X)]*[Y-E(Y)]

The “Expectation” operator is simply the average. This is calculated one of two ways

  • A weighted average , with weights typically being the probability of each state given. This usually occurs in an example where you have (typically) three states of the world (usually, it’s states of the economy), and are given the value of each variable in each state. You then take the weighted average of the deviations (in the case of variance) or cross deviations (in the case of covariance)
  • A simple (unweighted) average - in the case where you have equal likelihood of each observation, you use 1/n as the “weight” for each observation. This usually shows up when you have “N” observations. This is the plain old average we all learned in high school - the “add them up and divide by N” approach.

You might note that the variance of a random variable is the variable’s covariance with itself.

And as Magician has pointed out, if it’s a sample variance or sample covariance, you divide by N-1 instead of N.

NOTE: Edited to correct a few typos.

Dont you mean "the variance of X is the expected value of (X-E(X))^2"and similarly for the variance of Y?

Also, “the covariance of X and Y is the expected value of [X-E(X)]*[Y-E(Y)]”?

Minor typos wink

Thanks - edited my previous comment, so that others don’t get confused.