Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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))?


share|cite|improve this question
up vote 1 down vote accepted

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.