Let me explain what my goal is: I would like to define a hidden markov model with two hidden states and say, five possible observations. As I understand (I'm quite new to HMMs), in each state HMM will output one of the observations, based on the given output probabilites. I would like to extend this behaviour in such a way that the output is not dependant only on that probabilities, but also on the last observation that was output by the HMM.
You could think of it as if each hidden state had another (non-hidden) markov model embedded in itself, and use it to define the output. Both hidden states would have exactly the same markov models embedded, but with different transition probabilities.
I hope it is clear what I'm asking. Any hint would be greatly apreciated.