# Switching Kalman filter

The switching Kalman filtering (SKF) method is a variant of the Kalman filter. In its generalised form, it is often attributed to Kevin P. Murphy,[1][2][3][4] but related switching state-space models have been in use.

## Applications

Applications of the switching Kalman filter include: brain-computer interfaces and neural decoding, real-time decoding for continuous neural-prosthetic control[5], and sensorimotor learning in humans[6]. It also has application in econometrics,[7] signal processing, tracking,[8] computer vision, etc. It is an alternative to the Kalman filter when the system's state has a discrete component. For example, when an industrial plant has "multiple discrete modes of behaviour, each of which having a linear (Gaussian) dynamics".[9]

## Model

There are several variants of SKF discussed in.[1]

### Special case

In the simpler case, switching state-space models are defined based on a switching variable which evolves independent of the hidden variable. The probabilistic model of such variant of SKF is as the following:[9]

[This section is badly written: It does not explain the notation used below.]

{\displaystyle {\begin{aligned}&\Pr(\{S_{t},X_{t}^{(1)},\ldots ,X_{t}^{(M)},Y_{t}\})\\={}&\Pr(S_{1})\prod _{t=2}^{T}\Pr(S_{t}\mid S_{t-1})\times \prod _{m=1}^{M}\Pr(X_{1}^{(m)})\prod _{t=2}^{T}\Pr(X_{t}^{(m)}\mid X_{t-1}^{(m)})\times \prod _{t=1}^{T}\Pr(Y_{t}\mid X_{t}^{(1)},\ldots ,X_{t}^{(M)},S_{t}).\end{aligned}}}

The hidden variables include not only the continuous ${\displaystyle X}$ , but also a discrete *switch* (or switching) variable ${\displaystyle S_{t}}$ . The dynamics of the switch variable are defined by the term ${\displaystyle \Pr(S_{t}\mid S_{t-1})}$ . The probability model of ${\displaystyle X}$  and ${\displaystyle Y}$  can depend on ${\displaystyle S_{t}}$ .

The switch variable can take its values from a set ${\displaystyle S_{t}\in \{1,2,\ldots ,M\}}$ . This changes the joint distribution ${\displaystyle (X_{t},Y_{t})}$  which is a separate multivariate Gaussian distribution in case of each value of ${\displaystyle S_{t}}$ .

### General case

In more generalised variants,[1] the switch variable affects the dynamics of ${\displaystyle X_{t}}$ , e.g. through ${\displaystyle \Pr(X_{t}\mid X_{t-1},S_{t})}$ .[8][7] The filtering and smoothing procedure for general cases is discussed in.[1]

## References

1. ^ a b c d K. P. Murphy, "Switching Kalman Filters", Compaq Cambridge Research Lab Tech. Report 98-10, 1998
2. ^ K. Murphy. Switching Kalman filters. Technical report, U. C. Berkeley, 1998.
3. ^ K. Murphy. Dynamic Bayesian Networks: Representation, Inference and Learning. PhD thesis, University of California, Berkeley, Computer Science Division, 2002.
4. ^ Kalman Filtering and Neural Networks. Edited by Simon Haykin. ISBN 0-471-22154-6
5. ^ Wu, Wei, Michael J. Black, David Bryant Mumford, Yun Gao, Elie Bienenstock, and John P. Donoghue. 2004. Modelling and decoding motor cortical activity using a switching Kalman filter. IEEE Transactions on Biomedical Engineering 51(6): 933-942. doi:10.1109/TBME.2004.826666
6. ^ Heald JB, Ingram JN, Flanagan JR, Wolpert DM. Multiple motor memories are learned to control different points on a tool. Nature Human Behaviour. 2, 300–311, (2018).
7. ^ a b Kim, C.-J. (1994). Dynamic linear models with Markov-switching. J. Econometrics, 60:1–22.
8. ^ a b Bar-Shalom, Y. and Li, X.-R. (1993). Estimation and Tracking. Artech House, Boston, MA.
9. ^ a b Zoubin Ghahramani, Geoffrey E. Hinton. Variational Learning for Switching State-Space Models. Neural Computation, 12(4):963–996.