# Transition Probabilities in HMM

In the Wiki page on the Viterbi Algorithm (https://en.wikipedia.org/wiki/Viterbi_algorithm) there is an example of an HMM describing patients being in states "fever" or "healthy".

What I wish to understand is how I can calculate the transition probabilities, if I have the following info: Let's assume that the doctor has previously calculated the statistics for the time a patient is healthy, and has a fever.
He concluded that the annual number of days for being "healthy" and with "fever" are distributed normally, with $(\mu_h=350,\sigma_h=5)$ and $(\mu_f=15,\sigma_f=2)$ respectively.

Intuitively the transition probability from "healthy" to "healthy" is much higher than the transition probability from "fever" to "fever".
But how would I calculate the exact probabilities? (Assuming observations are done on a daily basis)

• If somebody is either healthy or has a fever, then the standard deviations should be the same – Henry Dec 12 '17 at 8:38

## 1 Answer

The Viterbi algorithm takes as input the transition probabilities; it doesn't estimate them. To use it to get an estimate for them, you could give an initial value for $A$, run the algorithm, look at the proportion of transitions, rerun the algorithm, etc. Repeating that until convergence gives you an iterative algorithm.

That said, I'm not sure there is enough information in just the distribution of sick days to really construct a HMM with transition probabilities, but you could just estimate (using the notation of the Wikipedia page):

\begin{equation} A = \begin{bmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{bmatrix} \end{equation}

By thinking about the proportion of transitions in the same way as in the iterative approach. You would need to find a way to sample $\{X_n\}_{n=1}^{365}$ such that $|X_n = \textrm{"fever"}| \sim \textrm{N}(15,2)$ and $|X_n = \textrm{"healthy"}| \sim \textrm{N}(350,5)$.

However, this is impossible for many reasons. First, the number of days is limited, so $|X_n = \textrm{"fever"}|=365 - |X_n = \textrm{"healthy"}|$. Second, the days are discrete, so using a normal will give you values that don't work with probability one. Third, it doesn't provide any dependency between how the "fever" days are distributed. Are the uniformly scattered, or clustered? I think you are trying to find the transition probabilities without providing any sort of temporal structure.