I have a series of observations that fall into two outcomes, 0 or 1. These observations have an associated time of observation, as well as additional features that I can gather for that observation. I am modeling this as having two hidden states A and B, where both have some probability of observing 0 or 1, and have some unknown transition probability between states. This transition probability varies with time and is correlated with the observation features.

How would I go about modeling this? My experience with HMM is with fixed transition probabilities (e.g. with Viterbi algorithm). Given a new observation, I want to be able to predict the hidden state as well as the transition probability. I would also want to generalize this model/use it as a prior for other similar models, each with different sets of observations.

Edit: I have discovered that what I am looking for is a variant of Baum-Welch that uses other feature data besides different sequences. How can I use my additional data in the prediction of the states?

  • 2
    $\begingroup$ Possible duplicate of Hidden Markov Model and volatile Matrix A $\endgroup$
    – Haitao Du
    Commented Sep 6, 2016 at 18:37
  • $\begingroup$ please see if my answer is helpful for above link. I would recommend not to do this because you might have overfitting problem $\endgroup$
    – Haitao Du
    Commented Sep 6, 2016 at 18:44
  • $\begingroup$ @hxd1011 interesting. what's your experience with these models? what have you used them on? $\endgroup$
    – Taylor
    Commented Oct 13, 2016 at 3:16
  • 1
    $\begingroup$ @Taylor for some human behavior modeling in cyber security research. $\endgroup$
    – Haitao Du
    Commented Oct 13, 2016 at 3:31
  • $\begingroup$ If I understood your problem correctly and the transition probability changes according to the time you have spend in each state, could Hidden Semi-Markov Models be another solution? $\endgroup$
    – DimP
    Commented Dec 12, 2016 at 17:56

2 Answers 2


What you are after I believe is a maximum entropy the (i.e. logistic regression) Markov model. I.e. you predict the transition probability using logistic regression on previous state and observations. There is apparently a way of training these without knowing the hidden states… I guess by expectation maximisation.


This transition probability varies with time and is correlated with the observation features.

Another option is to use a plain old factor graph, which is a generalization of a hidden markov model. You can model the domain knowledge that results in changing transition probability as a random variable for the shared factor.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.