Timeline for Computing the covaraince of two random variables given by a linear combination of samples drawn i.i.d from same distribution [duplicate]
Current License: CC BY-SA 4.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 17, 2021 at 15:26 | history | duplicates list edited | whuber♦ | duplicates list edited from Variance of a linear combination of vectors to Variance of a linear combination of vectors, The linearity of variance | |
May 17, 2021 at 15:26 | history | closed | whuber♦ probability Users with the probability badge or a synonym can single-handedly close probability questions as duplicates and reopen them as needed. | Duplicate of Variance of a linear combination of vectors | |
May 17, 2021 at 15:25 | comment | added | whuber♦ | stats.stackexchange.com/search?q=variance+linear+combination | |
May 17, 2021 at 15:23 | comment | added | Dave | From $x$ to what? Covariance involves two variables. | |
May 17, 2021 at 15:21 | comment | added | jdeJuan | the covariance from the vector $x$, i.e from $p(x)$. Note that $p(x)$ can be or not multivariate | |
May 17, 2021 at 15:20 | comment | added | Dave | What do you mean by $cov[x]$? Covariance applies to two variables. | |
May 17, 2021 at 15:18 | comment | added | jdeJuan | thanks Dave @Alexis. I have edited my question and title. Hope that you can know understand what is my problem. Note that I am not saying that the overall covariance between $z_1$ and $z_2$ is going to be zero, but how this covariance is computed and the fact that $\mathbb{E}[x_1x_2] - \mathbb{E}[x_1] \mathbb{E}[x_2] = COV(x_1,x_2) = 0$ as $x_1$ and $x_2$ have been drawn independently. | |
May 17, 2021 at 15:15 | history | edited | jdeJuan | CC BY-SA 4.0 |
deleted 348 characters in body; edited title
|
May 17, 2021 at 15:14 | comment | added | Dave |
If I set $a_1=a_2=a_3=1, a_4=2$ and do 10,000 replications with a sample size of 10 and that same set.seed(2021) , I get a minimum correlation of $0.42$. If I increase the sample size to 100, I get a minimum correlation of $0.88$. What you've proposed breaks down quite spectacularly (which is an excellent learning opportunity), and I am not sure that you're asking what you intend to ask.
|
|
May 17, 2021 at 14:47 | comment | added | Dave |
And the code @Alexis gave has independent x1 and x2 . // In the extreme, consider if $a_1 = a_3$ and $a_2 = a_4$. // Your question about the $a_1x_1 + a_2x_2$ seems quite different from what you originally asked. Perhaps consider editing the title and some of the earlier test in the question.
|
|
May 17, 2021 at 14:42 | comment | added | Alexis |
And your functions of $x_1$ and $x_2$ is not helping. Building off @Dave 's example set.seed(2021); N <- 10; x1 <- rnorm(N); x2 <- rnorm(N); a1 <- 2; a2 <- 3; a3 <- 1.5; a4 <- 2.5; z1 <- a1*x1 + a2*x2; z2 <- a3*x1 + a4*x2; cov(z1,z2) gives a covariance of 22.3.
|
|
May 17, 2021 at 14:38 | comment | added | jdeJuan | Hi @Alexis, thank you. I have edited my question to show what I am really interested in. The other is trying to be a simple example of the real thing I am trying to understand. | |
May 17, 2021 at 14:38 | comment | added | Dave | It looks like you goofed somewhere in your calculation, because covariance acts on two variables, not just the one $X$. (And what is $X$?) | |
May 17, 2021 at 14:36 | comment | added | Alexis | Welcome to CV, jdeJuan. I wonder if you are losing the distinction between population and sample? @Dave is most definitely giving an example with a sample. | |
May 17, 2021 at 14:35 | history | edited | jdeJuan | CC BY-SA 4.0 |
added 876 characters in body
|
May 17, 2021 at 14:23 | comment | added | jdeJuan | My question comes from the fact that independent samples have covariance zero. Perhaps I a missing something. Editing my question to make this clearer | |
May 17, 2021 at 14:17 | comment | added | Dave |
That's not going to be true. Try the following in R: set.seed(2021); N <- 10; x <- rnorm(N); y <- rnorm(N); cov(x,y) . I get a covariance of $\sim 0.8$, yet your conditions are satisfied. Even upping the sample size to $100,000$, I get a nonzero covariance.
|
|
May 17, 2021 at 14:10 | history | asked | jdeJuan | CC BY-SA 4.0 |