Let $X_1, X_2, \dots$ be a sequence of independent and identically distributed discrete random variables with common mass function $f_X(x)$ defined for when $x \in \{0,1,\dots,N\}$ and $N$ is known.
I know the form of $f_X(x)$ (I can computationally compute this mass over the range).
Now define $S = \sum_{i=1}^{M} X_i$ to be the $M$-sum of these random variables on the state space $\{0,1,\dots,NM\}$.
The problem that I have is that I observe realisations of $S$, where $M$ is the unknown parameter. Does anyone have any ideas as to how I can estimate $M$?
The idea I had was to try to compute the mass function for $S$ using $M$ convolutions but am not sure if this blows up computationally as $N,M$ increase. From this, I think I can search to find the $M$ which gives the likelihood its highest value, but again I believe this will run into computational issues. To make this more precise, typically $N \approx 10^4$ and $10^2 \leq M \leq 10^4$.
Any help would be greatly appreciated! Thanks