ction--><h2>Contents</h2><div><ul><li><a href="#1">Create a random hmm model</a></li><li><a href="#2">Sample data</a></li><li><a href="#3">infer single marginals using fwdback</a></li><li><a href="#4">infer single marginals using varelim</a></li><li><a href="#5">Infer single marginals using jtree</a></li><li><a href="#7">infer single marginals using libdai's Jtree code</a></li><li><a href="#8">Compare map assignments</a></li></ul></div><h2>Create a random hmm model<a name="1"></a></h2><pre class="codeinput"