I\'m trying to build the transition matrix for a Markov Chain in MATLAB; I have several different observation sequences (all of varying lengths) and I need to generate the t
This maybe an easier way for calculating the transition probability matrix (TPM) for a given sequence of data (one vector) like this:
myS = {S1,S2,S1,S3,...} with as many states as you have;
TPM = hmmestimate(myS,myS);
hmmestimate function is defined under hidden markov models in MATLAB.