Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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|improve this answer

Your Answer

 
discard

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.