2

For two centered (zero expectation) random variables $X$ and $Z$ I am interested in the covariance of the product $XZ$ and either $X$ or $Z$.

$$Cov(X,XZ) = E( X(XZ - E(XZ))) = E(X^2Z)$$

I think the last quantity can be non-zero. However, for any choice of $X$ and $Z$ I have tried, in simulations, I find the quantity to be approx. zero, see code. Perhaps I used examples for which the expectation above happens to be zero or the expectation simplifies further and turns out to be zero. Where do I go wrong?

#With correlated normal variables
library(MASS)
cors = -.9
n    = 10000
m    = c(0,0)
cova = matrix(c(1,cors,cors,1),ncol=2)
X    = mvrnorm(n,m,cova)

cor( cbind(X,X[,1]*X[,2]) )
mean(X[,1]^2*X[,2])

# With independent F-distributed variables
a = rf(n,df1=34,df2=506)
a = a - mean(a)
b = rf(n,df1=34,df2=506)
b = b - mean(b)

cor( cbind(a, b, a*b ))
mean(a^2*b)
tomka
  • 5,874
  • 3
  • 30
  • 71
  • 2
    For the independent sample, of course, $ E(X^2 Z) = E(X^2)E(Z) = 0 $, as $ E(Z) = 0 $ by construction. – Niels Wouda Jan 31 '17 at 16:12
  • Why does the result come out to be near 0 rather than exactly 0? – Michael R. Chernick Jan 31 '17 at 16:14
  • @N.Wouda okay, but note the square. Does it always hold that if $E(XZ)=E(X)E(Z)$, then $E(X^2Z)=E(X^2)E(Z)$? – tomka Jan 31 '17 at 16:14
  • @MichaelChernick sample variance I think? – tomka Jan 31 '17 at 16:15
  • 1
    @tomka see http://math.stackexchange.com/questions/220377/are-squares-of-independent-random-variables-independent – Niels Wouda Jan 31 '17 at 16:16
  • Try the empirical parameter to mvrnorm. – mdewey Jan 31 '17 at 16:16
  • The question had nothing to do with normal random variables. $E(X^2Z)$ is not a variance. – Michael R. Chernick Jan 31 '17 at 16:18
  • @Michael It's explicitly characterized as a covariance in the question, and [covariances are variances](http://stats.stackexchange.com/a/142472/919). – whuber Jan 31 '17 at 16:23
  • @MichaelChernick Don't fully understand. Are you saying it is not exactly zero but close? – tomka Jan 31 '17 at 16:24
  • 1
    I don't get zeros. Try this to see what's going on: `n – whuber Jan 31 '17 at 16:27
  • @whuber Good example. How did you construct it? I can see $E(X^2Z)=E(X^2 \exp(X))$ (while $X$ and $XZ$ not perfectly correlated). So may I argue, roughly, since $X$ is normal and so $\exp(X) \ge 0$ and $X^2 \ge 0$ we have $E(X^2 \exp(X)) \ne 0$? – tomka Jan 31 '17 at 16:44
  • 2
    You are getting near-zero values because your variables have symmetric distributions around zero, whence $E[X^2Z]=E[X^2(-Z)]=-E[X^2Z]$ implies the covariance must be zero. All you need to avoid this conclusion is to make $Z$ unsymmetric. Exponentiation is a strong, simple way to accomplish that. – whuber Jan 31 '17 at 16:46

0 Answers0