# Method of Moments for Mixture distribution

The restaurant owner also wants to reconfigure her seating layout, and has asked you for help in modeling her clients. She gives you a dataset of past reservations, and tells you that she gets a mix of single clients who come to sit at the bar, and people who come (alone or in groups) for dinner. You decide to model her clients using a mixture distribution, with fraction $$\alpha$$ of single bar patrons, and the remaining $$(1-\alpha)$$ fraction of diners; for the latter, you want to model the size of each group as $$1+N_p$$, where $$N_p$$ is Poisson distributed with parameter $$\lambda$$.

Compute the first and second moments.

The first moment is defined as $$\mu_1 = E[X]$$ and the second moment $$\mu_2 = E[X^2]$$. However, I am not sure what $$X$$ is in this case. Is it simply $$X=1+N_p$$, and then I take the expectation of this and the square of that same expression? In this case, I presume I have two equations for two unknowns and I solve for $$\alpha$$ and $$\lambda$$? Is this the case?

• X is the group size of the clients. This X is not just 1+N_p. X is a mixture between a 1+N_p and a single peak at 1. – Sextus Empiricus Oct 17 '20 at 20:53
• So X is defined piecewise as $1+N_p$ with prob $(1-\alpha)$ and $1$ with prob $\alpha$? – hkj447 Oct 17 '20 at 20:56
• Yes, and this results in a sum of the probability mass functions. Normally the distribution of the shifted Poisson ($N_p+1$) would be $$P(k) = \frac{\lambda^{k-1}e^{-\lambda}}{(k-1)!}$$ But now it is $$P(k) = (1-\alpha) \frac{\lambda^{k-1}e^{-\lambda}}{(k-1)!} + \alpha \mathbb{I}_{k=1}$$ where $\mathbb{I}_{c}$ is the indicator function which is 1 if the condition $c$ is true and 0 otherwise. – Sextus Empiricus Oct 17 '20 at 21:04
• I see. Could I still calculate the mean and end up with something like $E[X] = \alpha + (1-\alpha)(1+ E[N_p])$? Or do I have to use that complicated thing? – hkj447 Oct 17 '20 at 21:07
• BTW it is a bit strange to use $1+N_p$ for the remaining (not single bar patrons) because the Poisson variable can be 0 and then $1+N_p$ can be 1 (but it is not for single clients). – Sextus Empiricus Oct 17 '20 at 21:07

The probability mass distribution for a mixture distribution of discrete distributions is like a sum of the probability mass distributions for the distributions in the mixture.

$$p(x) = \alpha p_1(x) + (1-\alpha) p_2(x)$$

when you compute the mean you get

$$\begin{array}{rcl} E[X] &=& \sum_{ x} x p(x) \\ &=& \sum_{ x } x (\alpha p_1(x) + (1-\alpha) p_2(x))\\ & =& \alpha \sum_{ x } x p_1(x) + (1-\alpha) \sum_{ x } x p_2(x) \\ &=& \alpha E[X_1] + (1-\alpha) E[X_2] \end{array}$$

when you compute the variance then you get

$$\begin{array}{rcl} Var[X] &=& \sum_{ x} (x-E[X])^2 p(x) \\ \\ &=& \alpha \sum_{ x } (x-E[X])^2 p_1(x) + (1-\alpha) \sum_{ x } (x-E[X])^2 p_2(x) \end{array}$$

these are not the variance of the original variables but instead the moment about a point (the point $$E[X]$$) which is not the original mean of the distributions.

$$\begin{array}{rcl} \sum_{x} (x-c)^2 p(x) &=& \sum_{x}(x-\mu_x+\mu_x-c)^2 p(x)\\ &=& \sum_{x}\left((x-\mu_x)^2 + 2 (x-\mu_x)(\mu_x-c)+ (\mu_x-c)^2 \right)p(x)\\ &=& \sum_{x}\left((x-\mu_x)^2 + (\mu_x-c)^2 \right)p(x)\\ &=& Var(x) + (\mu_x-c)^2\\ \end{array}$$
$$E[X] = \alpha E[X_1] + (1 -\alpha) E[X_2]$$ $$Var[X] = \alpha Var[X_1] + (1 -\alpha) Var[X_2] + \alpha (E[X_1]-E[X])^2+ (1-\alpha) (E[X_2]-E[X])^2$$