I got a an exercise problem which should be seen as a HMM scenario and argument some statements. However I'm quite confused about how to properly solve and argument my solutions.
Problem tells:
Imagine you want to determine the annual temperature centuries of years ago, when of course there wasn't any thermometer or records. So, nature as an evidence is a worth to try resource, we may achieve it by watching at tree's inside rings. There's reliable evidence suggesting that there's a relation among the rings inside trees and temperature. There will be 2 different temperature states, WARM (W) and COLD (C) and three discretized tree rings sizes: SMALL (S), MEDIUM (M) and LARGE (L). Some researchers have provided two matrixes:
$\begin{bmatrix}.7 & .3\\.4 & .6\end{bmatrix}$
As transition matrix, so the probability of remaining in COLD state if COLD is present is $.6$ and the probability of passing from COLD to WARM is $.7$.
Also, a second matrix with the relation among the ring's size and the temperature over the year:
$\begin{bmatrix}.1 & .4 & .5\\.7 & .2 & .1\end{bmatrix}$
So, problem asks what I should do to calculate the chance of a sequence (for example):
SSSMMLLL
To happen. I considered multiplying the 4 distinct cases and so generate a Markov matrix with transitions among trees ring sizes. However I never got a matrix whose rows sum 1 as it should.
How could I solve this?
The temperature transition matrix is $$ A= \left( \begin{array}{cc} .7 & .4 \\ .3 & .6 \end{array} \right) $$ in the sense that if the distribution of temperature at year $n$ is given by the 2x1 column vector $t^{(n)}$ then
$$t^{(n+1)} = At^{(n)}$$
First step is that you need some assumption about the first year's temperature distribution, and the only natural assumption to make is that it is the stable distribution. Eigenvector analysis shows this is $$ t^{(0)} = \left( \begin{array}{c} 4/7 \\ 3/7 \end{array} \right) $$ Then for each year, we calculate a prior distribution for $t^{(n)}$, as $$ \bar{t}^{(n)} = A t^{(n-1)} $$ for example, $$ \bar{t}^{(1)} = \left( \begin{array}{c} 4/7 \\ 3/7 \end{array} \right) $$ And then we calculate the probabilities for the two states consistent with the value of size at year $n$. For example, with year 1 recorded as $S$, $$\begin{array}{c} P_{WS}^{(1)} = \bar{t}_W^{(1)} B_{WS} = 4/7 \cdot 0.1 = 4/70 \\ P_{CS}^{(1)} = \bar{t}_C^{(1)} B_{CS} = 3/7 \cdot 0.7 = 3/10 \end{array} $$ Then the total probability of seeing that size state in year 1 is the sum of those $(25/70 = 5/14)$ and here is the key point, the new hidden temperature state is obtained by normalizing, because with 100% probability you did end up in the $S$ state in year 1: $$ t^{(1)} = \left( \begin{array}{c} 4/25\\ 21/25 \end{array} \right) $$ Now you do the same for the second year. (There must be some way to simplify the normalization factors, but I don't see it.) $$ \bar{t}^{(2)} = \left( \begin{array}{cc} .7 & .4 \\ .3 & .6 \end{array} \right) \left( \begin{array}{c} 4/25 \\ 21/25 \end{array} \right) = \left( \begin{array}{c} 0.652 \\ 0.348 \end{array} \right) $$ $$\begin{array}{c} P_{WS}^{(1)} = \bar{t}_W^{(1)} B_{WS} = 0.448 \cdot 0.1 = 0.0448 \\ P_{CS}^{(1)} = \bar{t}_C^{(1)} B_{CS} = 0.552 \cdot 0.7 = 0.3864 \end{array} $$ Then the total probability of seeing that size state in year 1 is the sum of those $(0.4312)$ so that the probability of a start of $SS$ is $0.4312 \cdot 5/14$, and the new hidden temperature state is obtained by normalizing, $$ t^{(2)} = \left( \begin{array}{c} 448/4312\\ 3864/4312 \end{array} \right) $$ You now do year 3, starting with this very-probably-cold temperature distribution, and so forth.
One thing: You will get a very small overall probability but it is not valid to conclude from that that there is some warming trend or whatever. Because any given specific sequence will have a lo probability. Evaluating the statistical significance of this is quite a subtle matter.