Var of Sum of Random Variables when n is a Random Variable?

In summary, the conversation discusses the equation Var(\sum_{i=1}^{n}X_i) = \sum_{i=1}^{n}Var(X_i) and whether it still holds when n is a random variable. The participants discuss the Law of Total Variance and the implications for the equation when n is a random variable. They also mention that the correlation between the sum of X's and n may affect the accuracy of the equation. Finally, there is confusion about the use of notation for the random variable N and the value n.
  • #1
jimmy1
61
0
If I have a set of indepenent and identically distributed random variables X1,...Xn, then [tex]Var(\sum_{i=1}^{n}X_i) = \sum_{i=1}^{n}Var(X_i)[/tex].

Now I want to know what the sum of variances of Xi would be when n is a random variable?
I'm guessing the above statement still holds when n is a random variable, but when I work out both sides of the above statement, I get two different answers.

For example, [tex]Var(\sum_{i=1}^{n}X_i)[/tex] will now be the variance of a random sum of random variables which can be worked out using the total law of variance, and comes out as E(n)*Var(X1) + Var(n)*E(X1)^2.
But evaluating the other side of the expression [tex]\sum_{i=1}^{n}Var(X_i)[/tex] when n is a random variable comes out as E(n)*Var(X1).

So, I don't understand why I'm getting two different answers here?? Which one is correct?? I think they should be the same.
 
Physics news on Phys.org
  • #2
The first equation (var(sum)=sum(var)) does not hold if n is a random variable.
 
  • #3
By Law of Total Variance, and letting E[X] = [itex]\mu[/itex] and Var[X] = [itex]\sigma^2[/itex],

Var[[itex]\sum_1^n[/itex] X] = E[Var[[itex]\sum_1^n[/itex] X|n]] + Var[E[[itex]\sum_1^n[/itex] X|n]] = E[Var[[itex]\sum_1^n[/itex] X]] + Var[n[itex]\mu[/itex]|n] = E[n[itex]\sigma^2[/itex]] + 0 = [itex]\sigma^2[/itex]E[n].
 
Last edited:
  • #4
EnumaElish said:
Var[[itex]\sum_1^n[/itex] X] = E[Var[[itex]\sum_1^n[/itex] X|n]] + Var[E[[itex]\sum_1^n[/itex] X|n]] = E[Var[[itex]\sum_1^n[/itex] X]] + Var[n[itex]\mu[/itex]|n] = E[n[itex]\sigma^2[/itex]] + 0 = [itex]\sigma^2[/itex]E[n].

Are you sure the terms highlighted are correct?

Shouldn't it read:

Var[E[[itex]\sum_1^n[/itex] X|n]] = Var[n[itex]\mu[/itex]] = Var[n][itex]\mu^2[/itex] ??

And therefore, as mathman has stated (var(sum)=sum(var)) does not hold when n is a random variable?
 
  • #5
I agree with Jimmy.
 
  • #6
I agree to the general proposition; in my previous post I was making an error: I wrote Var[E[sum|n]] = Var[n[itex]\mu[/itex]|n], which should have been Var[n[itex]\mu[/itex]].

As I thought about the problem, I came to realize the following two special cases.

First, if [itex]\mu[/itex] = 0 then the "complicated" formula (with the Var[n[itex]\mu[/itex]] term) reduces to the simple formula. For example, if the X's are distributed normally with mean 0, then there is no difference between the two formulas.

Second, the linear relationship E[[itex]\sum_1^n[/itex] X|n] = a + b n, where a = 0 and b = [itex]\mu[/itex] implies:

Explained variance/Total variance = Var[E[[itex]\sum_1^n[/itex] X|n]]/Var[[itex]\sum_1^n[/itex] X] = Corr[[itex]\sum_1^n[/itex] X, n]2 or Var[E[[itex]\sum_1^n[/itex] X|n]] = Corr[[itex]\sum_1^n[/itex] X, n]2 Var[[itex]\sum_1^n[/itex] X] ... ... ... ... ... ... ... ... ... [Eq. 1],

which implies that the degree to which that the simple formula differs from the complicated formula is an empirical question. If it so happens that the correlation between the sum of X's and n is not significantly different from zero, then the two formulas will produce practically an identical result.

Here is a neat point, though: one can look at the equation [itex]\sum_1^n[/itex] X = [itex]\alpha[/itex] + [itex]\beta[/itex]n + [itex]\epsilon[/itex] as a least squares regression, where E[itex]\alpha[/itex] = 0, E[itex]\beta[/itex] = [itex]\mu[/itex] and E[itex]\epsilon[/itex] = 0. Remember that the least squares estimator [itex]\beta[/itex] of b in Y = a + bZ is [itex]\beta[/itex] = Cov(Y,Z)/Var[Z]. By letting Y = [itex]\sum_1^n[/itex] X and Z = n, one has [itex]\beta[/itex] = Cov([itex]\sum_1^n[/itex] X, n)/Var[n]. But E[itex]\beta[/itex] = [itex]\mu[/itex], so when Var[n] is given, there is a direct relationship between the Cov term and [itex]\mu[/itex], the mean of each X. And since Corr(Y,Z) = Cov(Y,Z)/([itex]\sigma_Y\sigma_Z[/itex]), there is a direct relationship between Corr[[itex]\sum_1^n[/itex] X, n] and [itex]\mu[/itex].

With a little computer programming, one can verify that when the X's are i.i.d. Normal[0,1], Corr[[itex]\sum_1^n[/itex] X, n] ---> 0 as expected (because [itex]\mu[/itex] = 0, the linear relationship implies zero correlation: b = [itex]\mu[/itex] = 0 and the [unbiased] least squares estimator of b = [itex]\beta[/itex] = 0; therefore the correlation has to be zero).

The intuition is that if the X's are sampled equally on both sides of the origin, then the number of X's being summed up does not change the expected value of the sum (= zero). Therefore the correlation between the sum and n is zero. Even neater, if [itex]\mu\approx[/itex] 0, then Cov [itex]\approx[/itex] 0, i.e. the simple relationship can be a good approximation even when [itex]\mu[/itex] isn't identically zero. The approximation worsens as [itex]\mu[/itex] gets farther away from zero. Which is a roundabout way of saying that Var[n[itex]\mu[/itex]] [itex]\approx[/itex] 0 if [itex]\mu\approx[/itex] 0.
 
Last edited:
  • #7
hello people,

this is sofie.
i was wondering how jimmy1 got the result:
var(\sum_{i=1}^{N})=E(N)var(X) + var(N)(E(X))^2 using the law of total variance.

hope someone can tell me,
thanks!
 
  • #8
I'm confused because you all use the notation n for both the random variable N and for the value of this N.
I get E(nVar(X1))+(E(X1))^2Var(n) and I don't know how that is the same as when n would be replaced by N.
 

1. What is the "Var of Sum of Random Variables when n is a Random Variable"?

The "Var of Sum of Random Variables when n is a Random Variable" refers to the variance of the sum of a set of random variables, where the number of variables in the sum is also a random variable.

2. Why is it important to calculate the Var of Sum of Random Variables when n is a Random Variable?

Calculating the variance of a sum of random variables allows us to understand the variability in the combined outcome of multiple random events. When the number of variables in the sum is also a random variable, it adds an extra level of complexity and understanding this can provide valuable insights in various fields such as finance, economics, and statistics.

3. How is the Var of Sum of Random Variables when n is a Random Variable calculated?

The Var of Sum of Random Variables when n is a Random Variable is calculated using the formula Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y), where X and Y are random variables and Cov(X,Y) is the covariance between them.

4. What are some real-world applications of the Var of Sum of Random Variables when n is a Random Variable?

The Var of Sum of Random Variables when n is a Random Variable has various real-world applications such as portfolio management in finance, predicting stock market movements, analyzing risk in insurance, and understanding the variability in weather patterns.

5. What are the assumptions made when calculating the Var of Sum of Random Variables when n is a Random Variable?

When calculating the Var of Sum of Random Variables when n is a Random Variable, it is assumed that the random variables are independent of each other and that they have a finite variance. Additionally, the random variable n is assumed to follow a known probability distribution.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
971
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
834
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
478
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
545
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
446
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
842
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
798
Back
Top