Solution (source code)

= Solution

Write $P_{rs}(t;q)$ for the transition probabilities generated by the constant intensity matrix. The <panel-observed multi-state likelihood> contributions are:

* For patient 1, observation in state 2 at year 2 followed by a direct death from state 2 one year later contributes
  $$
  P_{12}(2;q)P_{22}(1;q)q_{25}.
  $$

* Patient 2 may have entered the stroke state either without or with unobserved dementia. The exactly timed stroke contributes
  $$
  P_{11}(0.5;q)q_{13}+P_{12}(0.5;q)q_{24}.
  $$
  With no information after admission, the later contribution is one.

* For patient 3, sum over the two possible states immediately after the stroke, propagate to observed state 4 over the following $1.5$ years, and then require death directly from state 4:
  $$
  \left\{
  P_{11}(0.5;q)q_{13}P_{34}(1.5;q)
  +P_{12}(0.5;q)q_{24}P_{44}(1.5;q)
  \right\}P_{44}(1;q)q_{45}.
  $$