1
$\begingroup$

The forward–backward algorithm is an inference algorithm for hidden Markov models which computes the posterior marginals of all hidden state variables given a sequence of observations/emissions

The transition matrix is

$\mathbf {T} ={\begin{pmatrix}0.7&0.3\\0.3&0.7\end{pmatrix}}$

in the context of 'Rainy' and 'Sunny', could the transition matrix be viewed as follow?

$T_{11} = 0.7, T_{12} = 0.3$ means the day after a Sunny day has a 70% chance of being Sunny day (staying), and a 30% chance of being Rainy (transitioning),

while $T_{21} = 0.7, T_{22} = 0.3$ means the day after a Rainy day has a 30% chance of being Rainy day (staying), and a 70% chance of being Sunny (transitioning).

is my understanding right?

$\endgroup$
  • 3
    $\begingroup$ I don't know lots of the terminology of the first paragraph, but everything after that is correct. $\endgroup$ – Viktor Glombik Jul 24 '19 at 21:55
1
$\begingroup$

When using the vector-matrix multiplication $\pi_{n+1}= \pi_n\mathbf T$, then $\mathbf T_{xy}$ is the conditional probability of it being $y$ on the next day when given that it is $x$ the 'current' day; and we are valuing $x,y$ as 1 for rainy and 2 for sunny ($x$ is the row, $y$ the column).

$$\begin{bmatrix}\mathsf P(W_{n+1}{=}r),\mathsf P(W_{n+1}{=}s)\end{bmatrix}=\begin{bmatrix}\mathsf P(W_{n}{=}r),\mathsf P(W_{n}{=}s)\end{bmatrix}~\underbrace{\begin{bmatrix}\mathsf P(W_{n+1}{=}r\mid W_n{=}r)&\mathsf P(W_{n+1}{=}s\mid W_n{=}r)\\\mathsf P(W_{n+1}{=}r\mid W_n{=}s)&\mathsf P(W_{n+1}{=}s\mid W_n{=}s)\end{bmatrix}}_{\bf T}$$

  • $T_{11}$ is the probability that a rainy day follows a rainy day
  • $T_{12}$ is the probability that a sunny day follows a rainy day
  • $T_{21}$ is the probability that a rainy day follows a sunny day
  • $T_{22}$ is the probability that a sunny day follows a sunny day
$\endgroup$
  • $\begingroup$ Thanks for your answer. Does this part $\begin{bmatrix}\mathsf P(W_{n}{=}r),\mathsf P(W_{n}{=}s)\end{bmatrix}$ represent the initial state $\pi$? $\endgroup$ – czlsws Jul 25 '19 at 2:14
  • $\begingroup$ Yes. The vector $\pi_n$ contains the probabilities that the weather on day $n$ has the indicated value (rainy or sunny, respectively). $\endgroup$ – Graham Kemp Jul 25 '19 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.