# Clarification regarding theoretical mean and variance

I'm supposed to generate a dataset of size $$n=100$$ from a $$\Gamma(2,1/2)$$ distribution. This is easily done in R by Data=rgamma(100,2,1/2).

Then I'm asked to find the theoretical mean and variance of the above distribution. My question is, is this just the mean and variance of my size $$100$$ dataset above, that is mean(Data) and var(data)?

What is the difference between theoretical mean, sample mean and true mean?

EDIT: I'm inserting the entirety of the assignment to avoid confusions:

Generate a data set of size $$n = 100$$ from a $$Gamma(2,1/2)$$ distribution. What are the theoretical mean and variance of this Gamma distribution?

Let us say that our parameter of interest $$\theta$$ is the mean and that we will use the sample mean as estimator $$(\hat{\theta})$$ for it. What are the theoretical mean and variance of the estimator sample mean, when using $$n = 100$$ and knowing that the data comes from the distribution above? Distribution for sample mean?

• Sample statistics are estimates, true mean / theoretical mean is calculated from the distribution functions, you need to calculate $E[\Gamma(2,1/2)]$, which involves solving an integral, or maybe there is some shortcut. Sep 28, 2018 at 12:51
• But if that's just the mean of a gamma distribution with parameters $a$ and $b$ then the mean is simply $\mathbb{E}[\Gamma(a,b)]=a/b$? Sep 28, 2018 at 13:09
• Yes this is just the mean of a Gamma distribution, $a/b$. But read carefully the question as it involves the mean and variance of the empirical mean! Sep 28, 2018 at 13:28
• But I think the question is very confusing. They ask what the theoretical mean and variance of the estimator sample mean is. The estimator sample mean is just $\overline{X}$ that can be computed by mean(Data). Same for the variance. So how do I find the theoretical mean of $\overline{X}?$ Sep 28, 2018 at 13:37

I think there's a piece of information missing here. What are you meant to do with your sample of size $$n=100$$? Are you meant to find its mean?

As far as I can tell, the question could be asking one of two things.

1: Calculate the expected value, and variance of the sample mean.

The expected mean of your sample is the mean of the distribution you are sampling from. Any individual sample's mean will probably be different to the mean of the distribution (unless the sample is very big, then it asymptotes to the distribution mean), but on average, if you took many samples of size $$n=100$$ and took their mean, the average of these means would tend to the mean of the distribution. Likewise, it's fairly easy to prove that the variance of the sample mean is given by $$\frac{\sigma ^{2}}{N}$$, i.e. the variance of the underlying distribution divided by the sample size.

2: What is the theoretically expected mean and variance of the sample?

Again, the expected sample mean can easily be shown to be the distribution mean. The expected sample variance can be (somewhat more cumbersomely) to be shown to equal $$\sigma^{2}(\frac{N-1}{N})$$ in which $$\sigma ^{2}$$ is the distribution variance. In your case, this means you'd expect your sample variance, on average to be 0.99 as large as the distribution variance. Especially for small samples, one expects the sample variance to be smaller than the variance of the underlying distribution which generated the sample.

Edit (as you have clarified your original question). If you estimate the distributional mean with the sample mean, the expected value of the sample mean is the distribution mean (for more info on this: https://en.wikipedia.org/wiki/Gamma_distribution). The variance on this estimator, i.e., how far from its mean value (which is the same as the true value), this estimator will fall on average, can be shown to be $$\frac{\sigma ^{2}}{n}$$. This is related to what I said originally, the variance of the sample mean is given by $$\frac{\sigma ^{2}}{n}$$. The variance of the sample mean is a measure of how far the sample mean on average falls from its average value, but because the sample means's average value is the distribution mean, then the variance of the sample mean is also a measure of spread of the sample mean from the true mean, otherwise known as the standard error.

• Hi, thanks for the response. Please see my edit for further clarification. The emphasis is on the line in the question: "What are the theoretical mean and variance of the estimator sample mean." Sep 28, 2018 at 13:17
• I have edited to address your edit more explicitly Sep 28, 2018 at 16:19