# Solved – How to interpret Hidden Markov Model parameters (transition matrix, emission matrix, and pi values)

I am working on channel modeling for cognitive radio using HMM. I've written a MATLAB program for forward, backward and Baum-Welch algorithm for multiple sequences. After given some random input and running the program for 1000 to 4000 iterations I'm getting some results. But I'm not getting how to interpret my results.

Will be glad if anyone can talk about inputting matrix/log-likelihood/transition matrix/emission matrix.

Contents

``M = 3; % number of observation levels N  = 2; % number of states  % A - "true" parameters (of your validation model) prior0 = normalise(rand(N ,1)); transmat0 = mk_stochastic(rand(N ,N )); obsmat0 = mk_stochastic(rand(N ,M));  % B- using the real parameters in step A, simulate a sequence of states and corresponding observations n_seq = 5;  % you want to generate 5 multiple sequences seq_len= 100; % you want each sequence to be of length 100 obs_seq, state_seq = dhmm_sample(prior0, transmat0, obsmat0, n_seq, seq_len);  % C- like you say you do, generate some initial guesses of the real parameters (from step A) that you want to learn prior1 = normalise(rand(N ,1)); transmat1 = mk_stochastic(rand(N ,N )); obsmat1 = mk_stochastic(rand(N ,M));  % D - train based on your guesstimates using EM (Baum-Welch) [LL, prior2, transmat2, obsmat2] = dhmm_em(data, prior1, transmat1, obsmat1, 'max_iter', 5);  % E- Finally, compare whether your trained values in step D are actually similar to the real values (that generated your data) from Step A.  % The simplest way to do that is to print them side by side or look at the absolute differences... obsmat0 obsmat2  transmat0 transmat2 ``