# Hidden Markov model alternative that allows dependence on previous n states

I am working on a prototype framework.

Basically I need to generate a model or profile for each individual's lifestyle based on some sensor data about him/her, such as GPS, motions, heart rate, surrounding environment readings, temperature etc.

The proposed model or profile is a knowledge representation of an individual's lifestyle pattern. Maybe a graph with probabilities.

I am thinking to use Hidden Markov Model to implement this. As the states in HMM can be Working, Sleeping, Leisure, Sport and etc. Observations can be a set of various sensor data.

My understanding of HMM is that next state S(t) is only depends on previous one state S(t-1). However in reality, a person's activity might depends on previous n states. Is it still a good idea to use HMM? Or should I use some other more appropriate models? I have seen some work on second order and multiple order of Markov Chains, does it also apply HMM?

I really appreciate if you can give me a detailed explanation.

Thanks!!

• You can always construct a (standard) Markov model out of the vectors $X(t) = (S(t-n+1), S(t-n+2), \ldots, S(t))$: now each state $X(t)$ depends only on the values found in $X(t-1)$ and you're off and running.
– whuber
Mar 19, 2013 at 19:24
• Of course, @whuber's approach multiplies the dimension of the state space by $n$, which might cause problems in practice. You might also be interested in using conditional random fields, which are closely related to HMMs but make it easier to have dependencies further back in the state history. Mar 19, 2013 at 20:22