Likelihood of continuing a discrete series

If I have a series like "aaabbbabaabaabbaa" and I'd like to know whether next element in series is "a" or "b", would a Poisson distribution be best solution for this? If so, checking Poisson for "3" wouldn't be right since it can be >3 in the future. Would the the proper solution be 1-(P(1)+P(2))?

Thanks

-

1 Answer

That really depends on how you want to model the series. I would not use a Poisson distribution here because it basically corresponds to random coin flipping which means that you cannot predict "a" or "b" from the previous events.

If you can assume that the string distribution is stationary, which means that the probability of occurence of "a" or "b" does not depend on the absolute position in your string, I would use a nth-order Markov model. This means that you model the probability $P(s[i]|s[i-1],...,s[i-n])$. You can simply estimate it via relative frequency.

For example, if you use a first order Markov model, you get $$P(s[i]=a|s[i-1]=a) = \frac{\#(s[i]=a \mbox{ and } s[i-1]=a)}{\#(s[i-1]=a)}$$ and similarly for $P(s[i]=a|s[i-1]=b)$, $P(s[i]=b|s[i-1]=a)$, and $P(s[i]=b|s[i-1]=b)$.

If you want to predict whether what the next letter will be, you simply take the one which has larger conditional probability.

-