This is an excerpt from Manning's book Practical Probabilistic Programming. Login to get full access to this book.
Listing 8.5. Dynamic model with variable structure—code skeleton