# Best estimate for random values

Due to work related issues I can't discuss the exact question I want to ask, but I thought of a silly little example that conveys the same idea.

Lets say the number of candy that comes in a package is a random variable with mean $\mu$ and a standard deviation $s$, after about 2 months of data gathering we've got about 100000 measurements and a pretty good estimate of $\mu$ and $s$.

Lets say that said candy comes in 5 flavours that are NOT identically distributed (we know the mean and standard deviation for each flavor, lets call them $\mu_1$ through $\mu_5$ and $s_1$ trough $s_5$).

Lets say that next month we will get a new batch (several packages) of candy from our supplier and we would like to estimate the amount of candy we will get for each flavour. Is there a better way than simply assuming that we'll get "around" the mean for each flavour taking into account that the amount of candy we'll get is around $\mu$?

I have access to all the measurements made, so if anything is needed (higher order moments, other relevant data, etc.) I can compute it and update the question as needed.

Cheers and thanks!

• Is "batch" synonymous with "package"? If so, the question would be considerably clearer if you used the same word again. If not, please clarify the difference. Commented Apr 2, 2013 at 21:34
• I'm sorry, I forgot to add that a batch is several packages, I don't think it matters as we'll evaluate per "package" Commented Apr 2, 2013 at 21:52

It depends on your definition of "better." You need to define your risk function. If your risk function is MSE, you can do better than simply using the sample means. The idea is to use shrinkage, which as the name suggests means to shrink all your $$\mu_i$$ estimates slightly towards 0. The amount of shrinkage should be proportional to the sample variance $$s^2$$ of your data (noisier data calls for more shrinkage) and inversely proportional to the number of data points $$n$$ that you collect. Note that the James-Stein estimator is only better for $$m \ge 3$$ flavors. In general, some form of regularization is always wise in empirical problems.
I find the question a bit unclear but since you have an estimate of the mean and standard deviation for a single package, assuming the candy in each package is independent why not use, $E(X_1+X_2)=E(X_1)+E(X_2)$ and $Var(X_1+X_2) = Var(X_1) + Var(X_2) + 2*cov(X_1,X_2)$ ?
• Since we want to get an estimate for each "flavour" we are now using $\mu_1$ through $\mu_5$. I would like to know if there is a better method to estimate how many of each "flavour" we'll get. Commented Apr 2, 2013 at 22:00
• I do no think that you can do beter then using the distirubtion of each flavour. If for example you would know that $\sigma_1=\sigma_2$ you could use a pooled variance estimator to get a better estimate $s_{pooled}$ for $\sigma_1$ and $\sigma_2$. The same reasoning holds for $\mu$. Commented Apr 3, 2013 at 10:14