# Relationship between mean and variance of samples

I am thinking about the relationship between sample mean and variance in an example. If we want to look at the average goals per month for a soccer team. And we have mean and variance of goals for each month. Now we find average goals per match is higher if goals per match in a month variates a lot. Is the high correlation between mean and variance defined by math, or it deserved to explore.

It may indicate that some part of the team is impacting the number of goals. For example the strategy, the team may have a rotation on players. So substitutes have no goals in first 2 matches, and starting lineup have extremely high goals after well rest. In this case, mean would be greater than having starting 11 players on every match and getting really tired.

Further, if we add samples variance to the nonlinear model to predict mean, dose the variance provides a unique contribution to the model, or it is more of a self-learning?

• I believe the reason you see a larger mean when you have larger variance is because goals per match is always non-negative. You probably also see a lot of 0 and 1's. I imagine if you were looking at mode/median there would be a much smaller effect if any on those values when increasing the variance. Keep in mind that an average is sensitive to outliers. – M Waz Aug 16 at 19:27
• Right, thanks for the answer Waz! But goals one is just an example. What I am facing is a positive but normally distributed sample, removing z score>2. So the mean is in good quality. – Liangliang Huang Aug 16 at 20:40

As goals scored in soccer matches are typically rare events, you might want to consider your data as coming from Poisson distributions. If so, then the variance in terms of goals per match will be equal to the average number of goals per match. Any changes in strategies, player health, opponent strength, and so on that affect the average number of goals per match from month to month would then necessarily also affect the variance.

If your variances are higher than corresponding means then a negative binomial distribution might be a better fit. But even then the variance will tend to increase with the mean values.

So your observation of a high correlation between mean and variance in soccer scores has a solid mathematical basis.

For data distributed normally, the mean and variance are independent. The PDF is parameterized by both values, which you can tweak to your heart's content.

For other distributions, the mean and variance are related. Let's consider the exponential distribution, which has PDF $$f(x\vert\lambda) = \lambda e^{-\lambda x}$$.

$$\mu_{f} = \dfrac{1}{\lambda}$$

$$\sigma^2_f = \dfrac{1}{\lambda^2}$$

There are mean-variance combinations that simply are not possible, even if the mean is possible and the variance is possible. For instance, we can have a mean of 1 when $$\lambda=1$$, but then $$\lambda = 1$$ and the variance cannot be $$1/4$$. Likewise, we can have a variance of $$1/4$$, but then $$\lambda = 2$$ and the mean cannot be one.

As Glen_b mentioned, something with counts may be more helpful for you. The Poisson distribution has an interesting property where the mean and variance are equal. There are mean-variance combinations that are impossible for Poisson-distributed data, and they're easy to predict (anything that isn't $$(\lambda,\lambda), \lambda>0)$$. So the mean and variance can be independent (normal) but don't have to be (exponential and Poisson).

• This is reasonable as a general answer on the way variance may or may not be related to the mean but in this case the data are counts ("number of goals") and is necessarily non-negative, for example, so examples focusing on the variance-mean relationships in typical count-data and/or count-data models (e.g. negative binomial regression models) might be more directly useful to the OP. – Glen_b Aug 18 at 3:49
• @Glen_b Do you have an example of a discrete distribution where the mean and variance are independent? – Dave Aug 18 at 4:11
• I believe there isn't one; independence of those two statistics characterizes the normal; see Geary, R.C. (1936). 'The Distribution of "Student's" Ratio for Non-Normal Samples'. Supplement to the Journal of the Royal Statistical Society. 3 (2): 178–184. – Glen_b Aug 18 at 7:33
• @Glen_b Maybe this warrants its own question, but how can that be for something like discrete (or continuous) uniform? I can center it wherever I want and scale it however I want. Knowing the first moment doesn't tell us anything about the second! – Dave Aug 18 at 15:39
• You're talking about the population parameters there - over which you indeed have full control and can move one without changing the other. When it comes to the joint distribution of sample mean and sample variance, however, it's easy to see the dependence in the case of a uniform. I think I have a continuous uniform example in an answer here somewhere. (NB they are uncorrelated, but you can see the dependence) – Glen_b Aug 18 at 23:27