For example: for a state sequence: 1 1 3 2 2 3 1 1 1 2 3
a21 = 1 / (3+1+1) = 1/5
a33 = 0 / (0+1+2) = 0
Hidden Markov Model
In hidden Markov model, the state is not directly represented in the observed
data sequence. Instead, the observed data is
only a proxy of the state or combination of states. For example, a
state can be observed by a color. The questions need to be answered by
the hidden Markov model is: (1) what is the sequence of states based on
the observed data; (2) what is the probability density function of observed
data, such as color, given a state; (3) what is the transaction matrix
among the hidden states; and (4) how many hidden states exist.
When building model, we need to decide when to use Markov model (MM)
and when to use hidden Markov model (HMM). In general, Markov states are
always discrete, while the proxy data for hidden Markov states can be continuum.
Thus, if the observed sequence is composed of continuous data, we should
consider using hidden Markov model.
Emission model
Assume the proxy data follows Normal distribution in each state, i.e. Pdf(Y|state=i)
= N(mu, sigma)
at time step t, Prob(state i) = rti
The predicted probability distribution at next time step can be represented
as: SUM{ rti * N(mu, sigma)}
This is a mixture of Normal, the mixture coefficients are computed
from the time series.
Data Generation
Assume there are N Markov states, and within each state, the data are distributed
based on N(mui, sigmai), i = 1,2...N The following
two step are used to generate data that can be recognized by HMM:
(1) generate a specific realization of the "hidden state" process
(2) for each state in the sequence, use N(mui, sigmai)
to generate the data distribution.
Implementation
"Predicting Daily Probability Distributions of S&P500 Returns" by Andreas
Weigend and Shanming Shi