Applying Hidden Markov Model

52 Views Asked by At

As I understand it, the HMM formula (see below) requires 3 parameters: initial distribution, transition probabilities and emission probabilities:

$$p(x_1,\ldots,x_n,z_1,\ldots,z_n) = p(z_1)p(x_1 \mid z_1) \prod_{t=2}^n p(z_t \mid z_{t-1}) p(x_t \mid z_t)$$

How can the following pieces of "given" information be used to calculate the 3 parameters, which in turn will compute the probability of a variable (price) at $T+1$?

(Note: Time series and transition matrices data are not included within post; focus is not end calculation, but rather clarification regarding the steps needed to get there).

  1. The price of an item over 100 timepoints, i.e. $T=100$
  2. The values of the price are between 1 and 50
  3. If the market is pessimistic the price changes from $t-1$ to $t$ with the probability transition matrix $\operatorname{pessimist}(t, t-1)$
  4. If the market is optimistic the price changes from $t-1$ to $t$ with the probability transition matrix $\operatorname{optimist}(t, t-1)$
  5. If the market is $pessimistic$ it will remain as such with probability of $0.8$
  6. If the market is $optimistic$ it will remain as such with probability of $0.7$
  7. At timestamp 1, the market is uniformly in either a pessimistic or optimistic state, and the price distribution is also uniform.

I'm interpreting the phrases "at timestamp 1 the market is 'uniformly' [in a] state" and "price distribution is also uniform" to mean $p(z_1) = \frac{1}{2}$ and $p(x_1 \mid z_1) = \frac{1}{50}$ respectively. Is this interpretation correct?

Further, as to the $\prod_{t=2}^n p(z_t \mid z_{t-1}) p(x_t \mid z_t)$ component, how do we calculate the probabilities $p(z_t \mid z_{t-1})$ and $p(x_t \mid z_t)$ for each $t$?