hmmProcess function

hmmProcess calculates the probability distribution of a random process following a Markov chain

hmmProcess calculates the probability distribution of a random process following a Markov chain

hmmProcess(prior, trans_mat, n)

Arguments

  • prior: Numeric vector or a one row matrix of length K representing the prior probabilities of the Markov chain.
  • trans_mat: Matrix of size (K,K)(K, K) representing the transition matrix of the Markov chain.
  • n: Numeric. Number of variables of the Markov chain.

Returns

Matrix of size (n,K)(n, K) giving the distribution of process given the K-state Markov chain parameters.

Details

hmmProcess calculates the distribution P(Z1,,Zn;π,A)P(Z_{1},\dots,Z_{n};\pi,A) of a Markov chain (Z1,,Zn)(Z_{1},\dots,Z_{n}) with prior probability π\pi and transition matrix AA.

The calculation is based on the following formula:

c("P(Zi=k)=sumlP(Zi=k,Zi1=l)=suml\nP(Z_{i} = k) = \\sum_{l} P(Z_{i} = k, Z_{i-1} = l) = \\sum_{l}\n", "P(Zi=kZi1=l)xP(Zi1=l)=sumlAlkxP(Zi1) P(Z_{i} = k | Z_{i-1} = l) x P(Z_{i-1} = l) = \\sum_{l} A_{lk} x P(Z_{i-1})")