# Estimating a distribution from sums of samples

I'm trying to figure out the parameters of a distribution from real data, but I only get their sums and counts. For either exponential or normal distributions.

So, I'll get the sum of 27 samples, paired with the number 27, and then the sum of 5 samples, paired with the number 5, etc. So sample $$S_1 = \Sigma_{i=1}^{27} s_i, C_1 = 27$$ and $$S_2 = \Sigma_{i=1}^{5} s_i, C_2 = 5$$, etc.

My first thought was to replicate means for each, but it seems a bit dumb.

Is there a smarter way? I was "good at math" some time ago, so I'm happy to do some reading to sort out details.

• For the exponential distribution, you can use ML estimator for $\lambda$; but for the normal, you can't estimate $\sigma$ with only count and sum. Dec 22, 2019 at 20:35
• Are the components ($s_i$) independent and identically distributed? How do you know they're exponential and normal, respectively? Dec 23, 2019 at 1:12
• Are $S_1$ and $S_2$ separate samples from the same normal distribution, or are they totally separate distributions? If totally separate, you indeed have no hope at estimating $\sigma$ (without further strong assumptions), but if you have 32 samples from the same normal distribution and you just only observe aggregated parts like this, assuming the division into parts is uniformly random, then you can definitely do that. Dec 23, 2019 at 1:22
• Hi, thanks for the responses. $S_1,S_2$ are both separate samples of the same thing. As an example (the actual domain is computer performance measurement, and I don't want to distract from the conversation), say they're times for a car around a track, where we have a moody timekeeper that only says "it took you 5:22 for 8 laps", where this guy randomly and independently selects the number of laps he times our car for. I don't care about his moods, I just want to know how fast the car is. Dec 23, 2019 at 22:13
• Let's take the type of distribution (exp, normal) as given by an oracle. Dec 23, 2019 at 22:15

This seems to be something like a self-study exercise so I won't presently give a full solution to every part but I will get you a fair way along.

Basic results on expectations and variances:

$$\qquad$$1. $$E(\sum_i s_i) = \sum_i E(s_i)$$

$$\qquad$$2. $$\text{Var}(\sum_i s_i) = \sum_i \text{Var}(s_i), \:$$ for independent variates

For iid exponentials with mean $$\mu$$, for given $$C_j$$, $$S_j$$ has population mean $$C_j\, \mu$$ and $$S_j/C_j = \overline{s}$$ has population mean $$\mu$$. You could estimate $$\mu$$ from a single $$(S,C)$$ pair. If you have more than one of them, you will want to weight them appropriately in a weighted average.

For iid normals with mean $$\mu$$ and standard deviation $$\sigma$$, for given $$C_j$$, $$S_j$$ has population mean $$C_j\, \mu$$ and $$S_j/C_j = \overline{s}$$ has population mean $$\mu$$. The variance of $$S_j$$ is $$C_j\, \sigma^2$$, and the variance of $$\bar{s}$$ is $$\sigma^2/C_j$$. If you only have $$S$$ and $$C$$ values available to you, you'll require more than one of them to estimate $$\sigma$$.

Usually, you'd solve problems like this via the method of maximum likelihood, rather than just by equating moments, but in these two cases, that turns out to be essentially the same thing.