## to calculate variance and CV from multiple (weighted) variables

Hello everybody,

My name is Sumet. I am studying in network traffic field. My background in statistic is not so strong; however, I have to calculate weighted sum of variables in order to determine variance and coefficient of variation (CV) of measured values. Please see the following descriptions. Any comments or suggestions for solution or suggestions for additional sources for references are very appreciated. Thank you.

Let Xi is a random variable of the measured value of something at the ith second. And Wi=Ni/$$\sum$$Ni, where Ni is the number of values obtain from measurement in the ith second.

Among Ni values, E[Xi] and var[Xi] are mean and variance of Xi (calculated and recorded in the ith second), respectively.

Over time T seconds, we obtain E[X1], E[X2],... ,E[XT], Var[X1], Var[X2], ..., and Var[XT].

Next, weighted sum of variables, $$\sum$$WiXi, will be focused. It is clear that mean (over time T) of mean of Xi can be determined from

E[$$\sum$$WiXi]=$$\sum$$(WiE[Xi]), for all i=1,2,3,...,T. ------------ (1)

But, in many references, there is no clear description for determination of variance (over time T) of mean of Xi; they just say that

Var[aX+bY] = a2Var[X] + b2Var[Y] + 2abCov(X,Y).

The followings are my understanding which I am not sure if it is correct. By the same manner as the above equation, the variance (over time T) of mean of Xi can be determined from

Var[$$\sum$$WiXi] = $$\sum$$Wi2Var[Xi] + Some_Covariance_Terms, for all i=1,2,3,...,T.

If Xi is statistical independent for each second, the terms Some_Covariance_Terms will be 0 and the equation becomes

Var[$$\sum$$WiXi] = $$\sum$$Wi2Var[Xi], for all i=1,2,3,...,T. ------------ (2)

And then CV can be calculated from the obtained mean from (1) and square root of the obtained variance from (2).

 Tags coefficent, sum of variables, variance, variation, weighted