function [prior, transmat, mixmat, mu, Sigma] = extract_mhmm_from_dbn(bnet)
% EXTRACT_MHMM_FROM_DBN Extract the parameters for a Mixture of Gaussians HMM from a DBN.
% [prior, transmat, mixmat, mu, Sigma] = extract_mhmm_from_dbn(bnet)
%
%   q1 -> q2 -> ...
%  / |   / |
% m1 |  m2 |
%  \ |   \ |
%   y1    y2
%
% where Pr(m=j|q=i) is a multinomial and Pr(y|m,q) is a Gaussian

prior = bnet.bnodes{1}.CPT;
mixmat = bnet.bnodes{2}.CPT;
transmat = bnet.bnodes{4}.CPT;
mu = bnet.bnodes{3}.mean;
Sigma = bnet.bnodes{3}.cov;
