<t>Thanks. I've got my code working now. It is ALL there in Hamilton's excellent book. Take a prior on the transition matrix/ variables (say mean, stdev etc.) and initialstate probabilty vector ( in the book. Then using the formulae in the book calclate the forecast, infered, and smoothed probabilit...