I am trying to apply R depmixS4 package in order to cluster time series with model based clustering. The model consists of K components, each being a first order Markov models. The Expectation-Maximization algorithm is then used to estimate model parameters.
My time series are multivariate and of arbitrary length ( i.e. can be 400, can be 1).
Now, there are 2 problems:
- depmixS4 is oriented towards Hidden Markov Models, not the basic first order ones.
- I do not completely understand the E and M-steps of model based clustering when applied to first-order Markov model components. Overwhelmingly, scientific literature talks about Hidden Markov Models.
However, it seems to me that simple first-order Markov models can be seen as a particular case of hidden ones (where the response probability distribution is just identity, response equals state - thus the states are actually visible). So the clustering process does not have to decode the hidden states. However, the E-M process itself is still unclear, and I am not sure if I can apply the depmixS4 package methods by adjusting them or should I develop my own algorithm in R.
The mixture Markov model used in my research, is the following:
$$p(v | \Theta) = \sum_{t=1\ldots K}p(c_k)p_k(v | \Theta_k),$$ where $v=v_1,\ldots,v_L$ - vector of arbitrarily length, and $$p_k(v |\Theta_k)=p(v_1| \Theta_{k_i})\prod_{i=2\ldots L} p(v_i |v_{i-1}, \Theta_{k_T}).$$ Given are also vector of initial state prior distribution and transition probability matrix $T_p$.