><span class="comment">% This file is from pmtk3.googlecode.com</span>

setSeed(0);
nstates = 250;
d = 10;
T = 100;
model = mkRndGaussHmm(nstates, d);
</pre><h2>Sample data<a name="2"></a></h2><pre class="codeinput">X = hmmSample(model, T, 1);
</pre><h2>infer single marginals using fwdback<a name="3"></a></h2><pre class="codeinput">tic
[gamma, logpHmm] = hmmInferNodes(model, X);
t = toc;
fprintf(<span class="string">'fwdbck: %g seconds\n'</span>, t);
</pre><pre class="codeoutput">fwdbck: 0.0856987 seconds
<