All probabilities are conditional on θ , and we use y$_{1:}$$_{t}$ to represent y$_{1}$, . . . , y$_{t}$ . We begin by defining distributions for the latent state at each time step, and the conditional likelihood: Mapping the elements of X to the indices { 1 , 2 , . . . , |X |} , a bijection, we express each P$_{t}$ and Q$_{t}$ as column vectors of length |X | . Define |X | × |X | state transition matrices T$_{t}$ as having ( i, j ) element Pr( X$_{t}$ = i | X$_{t}$$_{−}$$_{1}$ = j ). Similarly, define |Y| × |X | observation matrices Z$_{t}$ with ( i, j ) element Pr( Y$_{t}$ = i | X$_{t}$ = j ). The elements of each T$_{t}$ and Z$_{t}$ are defined by f$_{t}$ and g$_{t}$ , respectively, from (1). We rewrite (4) in matrix form as where A ( i ) is the i th row of A , A ′ denotes matrix transposition, and ∗ represents element- wise multiplication. The initial latent state distribution P$_{1}$ is specified by f$_{1}$ from the model specification (1), and all other P$_{t}$ , Q$_{t}$ , and L$_{t}$ terms are iteratively calculated using (5). The desired likelihood is calculated as L ( θ | y ) = L$_{1}$L$_{2}$ · · · L$_{k}$ . In related works ( e.g. , K´ ery and Schaub, 2012) T$_{t}$ and Z$_{t}$ may be transposed, resulting only in notational changes. 8 P$_{t}$ = T$_{t}$ Q$_{t}$$_{−}$$_{1}$, t ≥ 2 Q$_{t}$ = Z$_{t}$ ( y$_{t}$ ) ′ ∗ P$_{t}$ / L$_{t}$, t ≥ 1 L$_{t}$ = Z$_{t}$ ( y$_{t}$ ) P$_{t}$, t ≥ 1 , (5) P$_{t}$ ( x ) = Pr( X$_{t}$ = x | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) = ∑ x$_{t}$$_{−}$$_{1}$ ∈X Pr( X$_{t}$ = x | X$_{t}$$_{−}$$_{1}$ = x$_{t}$$_{−}$$_{1}$ ) Pr( X$_{t}$$_{−}$$_{1}$ = x$_{t}$$_{−}$$_{1}$ | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) Q$_{t}$ ( x ) = Pr( X$_{t}$ = x | y$_{1:}$$_{t}$ ) = Pr( X$_{t}$ = x | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) Pr( Y$_{t}$ = y$_{t}$ | X$_{t}$ = x ) / Pr( Y$_{t}$ = y$_{t}$ | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) L$_{t}$ = Pr( Y$_{t}$ = y$_{t}$ | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) = ∑ x$_{t}$ ∈X Pr( Y$_{t}$ = y$_{t}$ | X$_{t}$ = x$_{t}$ ) Pr( X$_{t}$ = x$_{t}$ | y$_{1:}$$_{t}$$_{−}$$_{1}$ ) (4)