Estimate Markov Chain Transition Matrix With Different State Sequence Lengths

1 view (last 30 days)
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 transition matrix using those.
To build a transition matrix with a single observation sequence, I can use--
x = [1 6 1 6 4 4 4 3 1 2 2 3 4 5 4 5 2 6 2 6 2 6]; % the Markov chain
tm = full(sparse(x(1:end-1),x(2:end),1)) % the transition matrix.
How can I construct one using state sequences of different length? One example can be that one sequence is 1,2,3,4 and another is 4,5,6.
  1 Comment
Tom Lane
Tom Lane on 1 Jun 2013
Can you explain more about what you want? If the two sequences are using different sets of states, how to you want to define a transition matrix? Is the issue that there may not be enough data so that all states appear in both sequences, even though they were theoretically possible? Or do you just want a separate transition matrix for each sequence? Or are the states such that you can't escape from certain subsets of states once you get into them? Or ...?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!