Analyzing Repetitive Sequences with Structured Dynamic Bayesian Networks