Unsupervised learning of stationary and switching dynamical system models from Poisson observations Authors: Christian Y Song, Maryam M Shanechi Published: 2023 ABSTRACT Abstract Objective. Investigating neural population dynamics underlying behavior requires learning accurate models of the recorded spiking activity, which can be modeled with a Poisson observation distribution. Switching dynamical system models can offer both explanatory power and interpretability by piecing together successive regimes of simpler dynamics to capture more complex ones. However, in many cases, reliable regime labels are not available, thus demanding accurate unsupervised learning methods for Poisson observations. Existing learning methods, however, rely on inference of latent states in neural activity using the Laplace approximation, which may not capture the broader properties of densities and may lead to inaccurate learning. Thus, there is a need for new inference methods that can enable accurate model learning. Approach. To achieve accurate model learning, we derive a novel inference method based on deterministic sampling for Poisson observations called the Poisson Cubature Filter (PCF) and embed it in an unsupervised learning framework. This method takes a minimum mean squared error approach to estimation. Terms that are difficult to find analytically for Poisson observations are approximated in a novel way with deterministic sampling based on numerical integration and cubature rules. Main results. PCF enabled accurate unsupervised learning in both stationary and switching dynamical systems and largely outperformed prior Laplace approximation-based learning methods in both simulations and motor cortical spiking data recorded during a reaching task. These improvements were larger for smaller data sizes, showing that PCF-based learning was more data efficient and enabled more reliable regime identification. In experimental data and unsupervised with respect to behavior, PCF-based learning uncovered interpretable behavior-relevant regimes unlike prior learning methods. Significance. The developed unsupervised learning methods for switching dynamical systems can accurately uncover latent regimes and states in population spiking activity, with important applications in both basic neuroscience and neurotechnology. Introduction Investigating neural dynamics underpinning naturalistic behaviors requires models of neural population activity that can balance explanatory power and interpretability. One class of models that can offer such a balance is a switching dynamical system model [1–4]. These switching models often use linear dynamics to describe the time evolution of neural population activity in terms of an underlying latent state; however, they allow for a switch non-stationarity such that a series of distinct linear dynamics called regimes can be pieced together to capture more complex neural dynamics. The ability of these models to capture switch non-stationarity could enable investigations of complex movement patterns and switching tasks [4–7], switches in attention and decision-making strategies [3, 8, 9], and even switches in how behavior is encoded in neural activity [10]. However, learning accurate switching models based on neural population activity data is a necessity for such endeavors, especially in the absence of reliable trial labels and/or regime labels. Neural population activity is typically measured in the form of spiking activity [11]. The binary nature of a spike event [12–18] can introduce challenges in the inference stage of various learning frameworks aimed at training data-driven models. We define inference as using observed neural activity to estimate latent states that give rise to both behavior and neural activity [11, 19–21] given model parameters. Prior learning methods for both stationary and switching dynamical systems that model spikes as discrete Poisson observations have used the Laplace approximation for inference [3, 12, 14, 22–25]. However, this approximation has the potential to lead to inaccurate learning as we will also show in our Results since it may not be able to capture the broader properties of the target of approximation [26]. Thus, there is a need for more accurate learning methods that can better learn the model parameters for both stationary and switching dynamical system models, and in turn facilitate the investigations of neural dynamics underlying behavior. For unsupervised learning, expectation–maximization (EM) is a commonly used two-step iterative framework. EM finds the model parameters according to a cost function that maximizes the log-likelihood of the observed neural activity in the training data [27], without any information about the latent states or regimes. The two steps are the expectation step (E-step) and the maximization step (M-step), where the E-step involves the inference of unobserved latent states. For switching systems, such exact inference is inherently intractable regardless of the observation modality [2], thus requiring an additional layer of approximation. Prior work called variational Laplace-EM (vLEM) [3] has made great progress using a mean-field variational approximation [28, 29] in a variational EM framework. However, variational EM has to modify the cost function to maximize the lower bound to the log-likelihood rather than the log-likelihood itself [29–31]. More importantly, in the E-step, vLEM also uses the Laplace approximation, which has the potential to lead to inaccurate learning. An alternative to a variational EM framework is what we will call a switch EM framework. The switch EM framework uses switching filters and smoothers [1, 2, 32–34] in the E-step to directly maximize the log-likelihood rather than its lower-bound as is done in variational EM. Switch EM has been successful for continuous Gaussian observations [6, 35] because accurate stationary filters can be incorporated in the switching filter in this case, specifically the Kalman filter which is optimal for Gaussian observations [30, 36]. Recent work [1] has extended switching filters to allow for Poisson observations using the Laplace approximation in the spirit of prior point process filters (PPF) [13, 16, 17, 22–24]. However, because the switch filtering method in this work [1] relies on incorporating stationary filters that are Laplace approximation-based, it does not have sufficient accuracy for model learning as we will show in our Results. Thus, there is a need for a more accurate filter to enable a successful switch EM framework for Poisson observations. With the goal to enable accurate unsupervised learning of both stationary and switching dynamical systems with Poisson observations, here we develop a novel deterministic sampling filter for Poisson observations called the Poisson Cubature Filter (PCF). The development of PCF for learning was motivated by the empirical results using a Laplace approximation-based filter in EM learning frameworks, which suggested the need for a more accurate filter for learning purposes. Prior deterministic sampling filters [37–40] however use a specific non-linear observation formulation that is not applicable to Poisson observations, thus necessitating a new filter. We start the development of PCF from a minimum mean-squared error (MMSE) approach to estimation which consists of various MMSE terms. However, these necessary MMSE terms are difficult to calculate analytically for Poisson observations. PCF overcomes this challenge by converting these terms using novel derivations into a form that enables the use of a numerical integration tool to approximate the terms. We then embed PCF in both stationary and switch EM frameworks as overviewed in figure 1 to enable accurate unsupervised learning of model parameters from just spiking activity observations. Poisson Cubature Filter (PCF) and how it enables EM learning for stationary and switching systems with Poisson observations. (a) PCF takes spiking activity modeled as Poisson observations and model parameters to causally decode unobserved latent states. (b) PCF is a recursive filter that is comprised of a prediction step followed by a measurement update step that is performed by utilizing deterministically sampled points based on cubature rules from numerical integration techniques. (c) PCF is embedded in an EM framework to enable accurate unsupervised learning of model parameters using only spiking activity as input. It is paired with an RTS smoother in the E-Step of EM. (d) PCF is also embedded in a switch EM framework to enable unsupervised learning of parameters for a switching dynamical system with Poisson observations. It is first embedded within a switching filter and then paired with a switching smoother to comprise the E-Step of switch EM. We first validate our methods with numerical simulations. We show that EM frameworks with PCF successfully learn accurate model parameters for both stationary and switching systems. Compared with learning methods that use the Laplace approximation for inference, the new method can learn the parameters significantly more accurately and improve the neural self-prediction, behavior decoding, and regime decoding. Also, comparisons with the same switch EM framework that instead uses the Laplace approximation-based PPF shows that successful learning depends on using the new PCF. We finally show that the benefits of switch EM with PCF are greater with smaller data sizes, showing that the method is more data-efficient and more reliable in identifying regimes in data compared to prior learning methods. We then show the success of both stationary and switch EM learning with PCF in publicly available motor cortical spiking activity data acquired from [41] from a non-human primate performing a continuous point-to-point reach task overviewed in figure 2. We find that the new PCF-based learning method for switching models succeeds in tracking regimes as evident by its significantly better decoding metrics compared to learned stationary models. We also find that PCF-based learning methods can outperform Laplace approximation-based methods in terms of the neural self-prediction and behavior decoding ability of learned parameters for both stationary and switching dynamical system models. Interestingly, despite being fully unsupervised with respect to behavior, we find that PCF-based learning uncovers interpretable and behavior-relevant regimes unlike prior learning methods. These results show the potential of the PCF-based EM frameworks for learning stationary and switching dynamical system models from neural datasets. Behavioral task overview. The task is a point-to-point task consisting of a continuous series of reaches to targets. To acquire the current target, the subject must hold on the target for 450 ms. Upon doing so, a new random target from the 8-by-8 grid is then presented, thus starting the next trial. The task is continuous and contains no pre-movement delay periods. Results We first provide a brief overview of the model and methods with full details available in section 4. We then show in both numerical simulations and in neural spiking activity recorded from primary motor cortex during behavior that unsupervised EM learning methods embedded with the developed PCF successfully learn system parameters and outperform prior methods for both stationary and switching systems. We further show that the PCF-based switch learning better identifies regimes in both simulated and experimental data and is more sample/data efficient. We use the Wilcoxon signed-rank test for all statistical comparisons and control for false discovery rate using the Benjamini–Hochberg Procedure [42]. Overview of unsupervised EM learning with PCF We use a switching dynamical system model with Poisson observations: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*}\begin{array}{*{20}{l}} {P\left( {s_t^{\left(\, j \right)}|s_{t - 1}^{\left( i \right)}} \right) = {{{\Phi }}_{j,i}}} \\[3pt] {{{\mathbf{x}}_t} = {\mathbf{A}}\left( {{s_t}} \right){{\mathbf{x}}_{t - 1}} + {{\mathbf{w}}_t},{{\mathbf{w}}_t} \sim N\left( {0,{\mathbf{Q}}\left( {{s_t}} \right)} \right)} \\[3pt] {P\left( {{{\mathbf{n}}_t}|{{\mathbf{x}}_t},{s_t}} \right) = \mathop \prod \limits_{i = 1}^C \frac{{{{\left( {{\lambda _i}\left( {{{\mathbf{x}}_t},{s_t}} \right){{\Delta }}} \right)}^{n_t^i}}\exp \left( { - {\lambda _i}\left( {{{\mathbf{x}}_t},{s_t}} \right){{\Delta }}} \right)}}{{n_t^i!}}{\text{ }}} \\[3pt] {{\lambda _i}\left( {{{\mathbf{x}}_t},{s_t}} \right){{\Delta }} = \exp \left( {{\alpha _i}\left( {{s_t}} \right) + {{\boldsymbol{\unicode{x03B2}}}_i}{{\left( {{s_t}} \right)}^T}{{\mathbf{x}}_t}} \right)} \end{array}.\end{align*}\end{document}P(st( j)|st−1(i))=Φj,ixt=A(st)xt−1+wt,wt~N(0,Q(st))P(nt|xt,st)=∏i=1C(λi(xt,st)Δ)ntiexp(−λi(xt,st)Δ)nti! λi(xt,st)Δ=exp(αi(st)+βi(st)Txt). Here, the latent brain state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{x}}_t} \in {\mathbb{R}^d}$\end{document}xt∈Rd evolves with linear dynamics dictated by \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\mathbf{A}}\left( {{s_t}} \right)$\end{document}Ast and its eigenvalues. For the spiking activity, the latent state is encoded in the instantaneous firing rate of Poisson observations \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{n}}_t} = {\left[ {n_t^1, \ldots ,{\text{ }}n_t^C} \right]^T}$\end{document}nt=nt1,…, ntCT through a log-link function. The regime state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${s_t} \in \left[ {1,M} \right]$\end{document}st∈1,M is a first-order Markov chain which dictates the parameters used throughout the model and enables the model’s functionality to describe non-stationary switches in dynamics and/or encoding. Stationary systems are then a special case of (1) with the number of regimes \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $M$\end{document}M equal to 1. See sections 4.2 and 4.5.1 for further details. For causal filtering with Poisson observations, the Laplace approximation is a popular approach, which is the basis for the prior PPF and can operate on Poisson observations [13, 16, 17, 22–24]. However, we find empirically that these methods can lead to inaccurate learning, especially in switching systems when the PPF is used in EM learning as we show in our below Results. We hypothesize that this inaccurate learning may be due to the inaccuracies in the Laplace approximation not being able to accurately capture first and second moments of densities that are being approximated [26]. More specifically, Laplace approximation may misrepresent first and second moments as shown in [26, 30, 43] for example in the case of skewed densities or densities in which the curvature at the mode that approximates the second-moment does not represent the mass in the tails. These issues may lead to inaccuracy in learning applications as second moment terms are critical in estimating system parameters (see section 4.4 and equation (44)). The approach of Laplace approximation-based filters resembles the non-linear filtering approach of the extended Kalman filter (EKF) [30] in that both of these approaches base their approximations around a single point through a Taylor series expansion [26]. While for continuous observations there are more accurate filters than EKF such as the unscented Kalman filter (UKF) and cubature Kalman filter (CKF) [30, 37–39, 44, 45] with comparable computational costs [30], these filters cannot be applied to Poisson observations. This is because these traditional non-linear filters generally assume the observation equation is of the form \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{n}}_t} = h\left( {{{\mathbf{x}}_t}} \right) + {{\mathbf{v}}_t}$\end{document}nt=hxt+vt where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $h\left( \cdot \right)$\end{document}h⋅ non-linearly but deterministically transforms the latent state and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{v}}_t}$\end{document}vt is some additive noise. However, for Poisson and other discrete observation modalities, the latent state is encoded in a probability distribution as in (1) with the actual observation being randomly drawn from that distribution. In other words, these modalities cannot be written in the above form, i.e., \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $h\left( \cdot \right)$\end{document}h⋅ does not exist for Poisson nor is there an easy modification to directly allow for Poisson. Therefore, we need to derive a new filter starting from fundamental estimation principles to allow for more accurate unsupervised learning with Poisson observations. Motivated by this need, we develop the PCF for unsupervised learning with EM. PCF is a recursive causal inference method for Poisson observations. We denote the estimation of latent state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{x}}_t}$\end{document}xt given observations \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{n}}_{1:\tau }}$\end{document}n1:τ as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\mathbf{x}}_{t|\tau }}$\end{document}xˆt|τ with estimated state covariance similarly denoted as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\boldsymbol{\Lambda }}_{t|\tau }}$\end{document}Λˆt|τ. As overviewed by figure 1(b), we start with the state estimate at the previous timestep \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\mathbf{x}}_{t - 1|t - 1}}$\end{document}xˆt−1|t−1 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\boldsymbol{\Lambda }}_{t - 1|t - 1}}$\end{document}Λˆt−1|t−1 and perform a prediction step using the linear dynamics of the model similar to Kalman prediction to yield the predicted state \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\mathbf{x}}_{t|t - 1}}$\end{document}xˆt|t−1 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\boldsymbol{\Lambda }}_{t|t - 1}}$\end{document}Λˆt|t−1 which is assumed to be Gaussian—this is a prediction because observations up to the previous timestep are used to predict the current state. The challenge comes in the following measurement update step that incorporates the new observation \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${{\mathbf{n}}_t}$\end{document}nt to yield the state estimate at the present timestep \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\mathbf{x}}_{t|t}}$\end{document}xˆt|t and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\boldsymbol{\Lambda }}_{t|t}}$\end{document}Λˆt|t. The Poisson observation is nonconjugate with the Gaussian density of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\hat {\mathbf{x}}_{t|t - 1}}$\end{document}xˆt|t−1, thus requiring approximation. Prior work has used the approach of approximating the update density through the Laplace approximation to yield the PPF [13, 16, 17] which can operate on Poisson observations. However, given the potential inaccuracy of the Laplace approximation for unsupervised learning purposes, we take a different approach and aim to minimize the mean-squared error of a state estimator that has the form: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*}\begin{aligned} {\hat {\mathbf{x}}_{t|t}} & = {\hat {\mathbf{x}}_{t|t - 1}} + {{\boldsymbol{\Lambda }}_{{\mathbf{xn}}}}{\boldsymbol{\Lambda }}_{{\mathbf{nn}}}^{ - 1}\left( {{{\mathbf{n}}_t} - {{\hat {\mathbf{n}}}_{{\mathbf{t}}|{\mathbf{t}} - 1}}} \right) \hfill \\ {\hat {\boldsymbol{\Lambda }}_{t|t}} & = {\hat {\boldsymbol{\Lambda }}_{t|t - 1}} - {{\boldsymbol{\Lambda }}_{{\mathbf{xn}}}}{\boldsymbol{\Lambda }}_{{\mathbf{nn}}}^{ - 1}{\boldsymbol{\Lambda }}_{{\mathbf{xn}}}^T \hfill \\ \end{aligned} .\end{align*}\end{document}xˆt|t=xˆt|t−1+ΛxnΛnn−1nt−nˆt|t−1Λˆt|t=Λˆt|t−1−ΛxnΛnn−1ΛxnT. For the above estimator form, the below terms are known to minimize the mean-squared error regardless of observation modality (see section 4.3).\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*}\begin{aligned} {\hat {\mathbf{n}}_{t|t - 1}} & = E\left[ {{{\mathbf{n}}_t}{\text{|}}{{\mathbf{n}}_{1:t - 1}}} \right] \hfill \\ {{\boldsymbol{\Lambda }}_{{\mathbf{nn}}}} & = V\left[ {{{\mathbf{n}}_t}{\text{|}}{{\mathbf{n}}_{1:t - 1}}} \right] \hfill \\ & = E\left[ {\left( {{{\mathbf{n}}_t} - {{\hat {\mathbf{n}}}_{t|t - 1}}} \right){{\left( {{{\mathbf{n}}_t} - {{\hat {\mathbf{n}}}_{t|t - 1}}} \right)}^T}\left| {{{\mathbf{n}}_{1:t - 1}}} \right.} \right] \hfill \\ {{\boldsymbol{\Lambda }}_{{\mathbf{xn}}}} & = E\left[ {\left( {{{\mathbf{x}}_t} - {{\hat {\mathbf{x}}}_{t|t - 1}}} \right){{\left( {{{\mathbf{n}}_t} - {{\hat {\mathbf{n}}}_{t|t - 1}}} \right)}^T}\left| {{{\mathbf{n}}_{1:t - 1}}} \right.} \right] \hfill \\ \end{aligned} .\end{align*}\end{document}nˆt|t−1=Ent|n1:t−1Λnn=Vnt|n1:t−1=Ent−nˆt|t−1nt−nˆt|t−1Tn1:t−1Λxn=Ext−xˆt|t−1nt−nˆt|t−1Tn1:t−1. These terms are expected values with respect to the non-Gaussian distributions \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $P\left( {{{\mathbf{n}}_t}|{{\mathbf{n}}_{1:t - 1}}} \right)$\end{document}Pnt|n1:t−1 and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $f\left( {{{\mathbf{x}}_t},{{\mathbf{n}}_t}|{{\mathbf{n}}_{1:t - 1}}} \right)$\end{document}fxt,nt|n1:t−1 and are difficult to calculate analytically, necessitating approximation. One way for approximating these terms is numerical integration. Numerical integration can be used to approximate expected value terms if they are with respect to a Gaussian through a series of weighted sums at deterministically sampled points (see section 4.1). However, our expected values above are not with respect to Gaussians. Thus, to derive the new PCF with Poisson observations, we must overcome the challenge of analytically converting the expected value terms in (3) into expected values with respect to Gaussians first, so that we can then enable the use of numerical integration. See section 4.1 for an overview of numerical integration and section 4.3 for a detailed derivation of how we do so. We now present the final equations. The prediction step is as follows: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*}\begin{array}{*{20}{l}} {{{\hat {\mathbf{x}}}_{t|t - 1}} = {\mathbf{A}}{{\hat {\mathbf{x}}}_{t - 1|t - 1}}} \\ {{{\hat {\boldsymbol{\Lambda }}}_{t|t - 1}} = {\text{ }}{\mathbf{A}}{{\hat {\boldsymbol{\Lambda }}}_{t - 1|t - 1}}{{\mathbf{A}}^T} + {\mathbf{Q}}} \end{array}.\end{align*}\end{document}xˆt|t−1=Axˆt−1|t−1Λˆt|t−1= AΛˆt−1|t−1AT+Q. The update step then updates the estimate with the current observation. The moment terms for the measurement update step are approximated with numerical integration as follows: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*} {{\hat {\mathbf{n}}}_{t|t - 1}} & \approx \mathop \sum \limits_{i = 1}^{2{d^2} + 1} {w_i} \cdot p\left( {{{\mathbf{x}}_i}} \right) \nonumber\\ {{\boldsymbol{\Lambda }}_{{\mathbf{nn}}}} & \approx \mathop \sum \limits_{i = 1}^{2{d^2} + 1} {w_i} \cdot \left( {q\left( {{{\mathbf{x}}_i}} \right) + p\left( {{{\mathbf{x}}_i}} \right)p{{\left( {{{\mathbf{x}}_i}} \right)}^T}} \right)\nonumber\\ & \quad - {{\hat {\mathbf{n}}}_{t|t - 1}}\hat {\mathbf{n}}_{t|t - 1}^T \nonumber\\ {\text{ }}{{\boldsymbol{\Lambda }}_{{\mathbf{xn}}}} & \approx \mathop \sum \limits_{i = 1}^{2{d^2} + 1} {w_i} \cdot {{\mathbf{x}}_i}p{{\left( {{{\mathbf{x}}_i}} \right)}^T} - {{\hat {\mathbf{x}}}_{t|t - 1}}\hat {\mathbf{n}}_{t|t - 1}^T \nonumber\\ {{\mathbf{x}}_i} & \triangleq {{\hat {\mathbf{x}}}_{t|t - 1}} + \sqrt {{{\hat {\boldsymbol{\Lambda }}}_{t|t - 1}}} {{\boldsymbol{\unicode{x03BE}}}_i} \end{align*}\end{document}nˆt|t−1≈∑i=12d2+1wi⋅pxiΛnn≈∑i=12d2+1wi⋅qxi+pxipxiT−nˆt|t−1nˆt|t−1T Λxn≈∑i=12d2+1wi⋅xipxiT−xˆt|t−1nˆt|t−1Txi≜xˆt|t−1+Λˆt|t−1ξi where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $p\left( \cdot \right)$\end{document}p⋅ and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $q\left( \cdot \right)$\end{document}q⋅ are the functions for the likelihood mean and variance of Poisson given by (14) and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $\left\{ {{w_i},{{\boldsymbol{\unicode{x03BE}}}_i}} \right\}$\end{document}wi,ξi are weights and points which are determined by a spherical–radial cubature rule given in (6) in section 4.1. Note that while Laplace approximation-based filters estimate the mean and covariance based on a single point in the latent space, PCF’s deterministic sampling method samples multiple points from the latent space. Having derived the novel PCF, we then embed it in EM frameworks to yield unsupervised learning methods for both stationary and switching systems that estimate model parameters given only Poisson observations as overviewed by figures 1(c) and (d). For stationary systems, we use PCF with an Rauch–Tung–Striebel (RTS) smoother in the E-step which we refer to as PCF-EM. We then compare to existing stationary methods: (1) PPF-EM which in its EM uses the widely-used PPF with Laplace’s approximation [16, 17, 22–24] and (2) Laplace-EM (LEM) which uses the global Laplace method for the entire E-step where Laplace approximation is applied non-causally to the entire observation timeseries [12, 14, 25] with details in section 4.4. For switching systems, we use what we call a switch EM framework where the E-step is comprised of a bank of parallel PCF filters in a switching filter. We call this switching filter switching PCF and call the entire learning method sPCF-EM. We compare to the prior Variational Laplace-EM (vLEM) method [3] which uses a distinct variational EM framework [28, 29] with global Laplace embedded in the E-step. We emphasize that a successful switch EM framework that uses the prior PPF filters has not been shown before. Nevertheless, to show that PCF enables a more accurate and reliable switch EM framework, we also implement and compare to switch EM but with PPF embedded (named sPPF-EM). We expand on the differences in section 4.5.3. Once models are learned with different learning methods in both simulations and experimental data, we compare the quality of learned parameters from different methods by using these learned parameters to perform state estimation with either PPF or switching PPF on held-out test data. Note that the model structure is identical regardless of what learning method is used. Thus, all differences in test set evaluations can be attributed to the learning methods. We compare the accuracy of the learned parameters for decoding latent states and performing one-step ahead prediction of the neural activity, which we refer to as neural self-prediction metric (section 4.6.2). For switching systems, we also decode regime states to evaluate decoded regime state accuracy. We refer to these metrics as decoding metrics and in simulation also normalize them by the decoding metrics from ground truth parameters: the normalized metrics range from 0 indicating chance to 1 indicating true performance. This gives us information both on how well the learned parameters can explain the data and on how similar they are to ground truth parameters. See section 4.6 for further details on simulation and evaluation methods. PCF yields high accuracy parameter learning in stationary simulations We first validate in simulations of stationary systems that PCF-EM can successfully learn accurate system parameters. We find that the latent state decoding and neural self-prediction metrics reaches 98.1% and 97.4% of that using ground-truth system parameters, respectively (figures 3(a) and (c)). Figures 3(a) and (c) further demonstrate that these decoding metrics converge toward the performance with true parameters as more training samples are provided, indicating learned parameters approaching ground truth values. While these results are for systems simulated with 2 ms time bins, we find the same trends with an increased time bin size of 10 ms as shown in figures A1(d) and (e). Also, the learned parameter error decreases with increasing training data size as shown in figures 3(e)–(i), again indicating successful parameter learning with PCF-EM (section 4.6.2). Finally, we find that PCF-EM significantly outperforms prior learning methods LEM and PPF-EM as seen throughout figure 3. In terms of learned parameter error, PCF-EM yields a 79.7% decrease in eigenvalue error compared to PPF-EM as shown in figure 3(i). In terms of decoding metrics, PCF-EM yields a 9.16% increase in latent state correlation coefficient (CC) over LEM in the largest training sample size case as shown in the rightmost cluster of figure 3(c). We emphasize that all learning methods use the same EM framework but differ in what inference method is used for the E-step as described in section 4.4; also, the evaluation of learned parameters uses the same pipeline with PPF as described in section 4.6.2. As such, all improvement can be attributed to the utilization of the new PCF for learning. PCF leads to improved unsupervised learning capabilities in simulated stationary systems. (a) Neural self-prediction (predictive power, or \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{PP}}$\end{document}PP) on held-out test data using learned parameters normalized by that using ground truth parameters according to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{PP}}/{\boldsymbol{PP}_{\boldsymbol{true}}}$\end{document}PP/PPtrue. Comparisons per training sample size are made between different learning methods: PCF-EM, PPF-EM, and Laplace-EM. Bars indicate the median metric, box edges indicate the 25th and 75th percentiles, and whiskers indicate minimum and maximum values excluding outliers that exceed 1.5 times the interquartile distance. Asterisks indicate statistical significance with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{***}{\boldsymbol{p}} < 0.0005$\end{document}∗∗∗p<0.0005. Trend lines connect at the median. (b) Same as (a) but un-normalized. (c) Same as (a) but showing the latent state decoding (correlation coefficient, or \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{CC}}$\end{document}CC) normalized by the CC using ground truth parameters according to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{CC}}/{\boldsymbol{CC}_{\boldsymbol{true}}}$\end{document}CC/CCtrue. Performance with learned parameters reaches 98% that with true parameters. (d) Same as (c) but un-normalized (e–h) normalized error of learned parameters with respect to true parameters over increasing training sample size. (i) Normalized error of learned eigenvalues of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\mathbf{A}}$\end{document}A. For each panel and statistical test, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n}} = 60$\end{document}n=60. PCF successfully learns parameters for both stationary and switching systems even with larger time bins. Simulations use 10 ms time bins compared to the 2 ms time bins of figures 3 and 4. Bar, box, whisker, outlier, and asterisk conventions are the same as in figure 4. (a)–(c) Decoding metrics on held-out switching test data similar to figures 4(a)–(h) but with 10 ms time bins. Top panels show normalized metrics while bottom panels show un-normalized. As in figure 4, decoding metrics with learned parameters from PCF trend towards those with ground truth parameters, indicating successful learning. (d), (e) Decoding metrics on held-out stationary data similar to figures 3(a)–(d) but with 10 ms time bins. In addition to the 2 ms time bins, PCF-based learning also successfully learns parameters for the 10 ms time bins. PCF yields high accuracy parameter learning in switching simulations We then find that PCF enables accurate parameter estimation for switching dynamical systems through a switch EM learning framework (sPCF-EM). Similar to section 2.2, as more training samples are provided in learning, the evaluation decoding metrics trend towards those obtained from filters using ground truth parameters as seen in figures 4(a),(d) and (g). Indeed, the neural self-prediction and regime state decoding metrics reach 90% of the performance using true parameters while latent state decoding reaches 84%, with more training samples expected to further increase these values. Similar trends are found even with increased bin sizes as shown in figures A1(a)–(c). Thus, the ability for the parameters learned by sPCF-EM to explain data and infer unobserved states approaches that of the ground truth parameters, indicating successful parameter learning. PCF leads to improvements in unsupervised learning in simulated switching dynamical systems with Poisson observations and 2 ms time bins. Bar, box, whisker, outlier, and asterisk conventions are the same as in figure 3. (a) Neural self-prediction on held-out test data using learned parameters normalized by that using ground truth parameters over an increasing number of training samples. Comparisons are made between different learning methods: sPCF-EM, sPPF-EM, and vLEM. (b) Same as (a) but un-normalized. (c) Normalized neural self-prediction over EM iterations at the largest training sample size of 316 k. (d) Regime state decoding on test data using learned parameters normalized by that using true parameters according to \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $\left( {\boldsymbol{Accuracy} - \frac{1}{\boldsymbol{M}}} \right)/\left( {{\boldsymbol{Accuracy}_{\boldsymbol{true}}} - \frac{1}{\boldsymbol{M}}} \right)$\end{document}Accuracy−1M/Accuracytrue−1M where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{M}}$\end{document}M is the number of regimes such that 0 is chance and 1 is true parameter performance. (e) Same as (d) but un-normalized. (f) Normalized accuracy over EM iterations. (g)–(i) Same as (a)–(c) but for latent state decoding with learned parameters. (j) Normalized regime state decoding accuracy using parameters trained with 100 k samples as a function of available initializations. After learning each initialization to completion (300 EM iterations), parameters associated with the initialization with the highest neural self-prediction in training set are chosen. (k) Neural self-prediction in training set at 316 k samples over EM iterations. While sPCF-EM and vLEM show consistent growth or convergence as expected of EM frameworks, sPPF-EM shows divergence showing the critical need for PCF to enable a switch EM framework. For each panel and statistical test, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n}} = 60$\end{document}n=60. We also find that PCF is critical in enabling a successful switch EM learning framework for Poisson observations by implementing and comparing to a switch EM that instead uses a PPF (sPPF-EM). Note that a successful switch EM even with a PPF has not been demonstrated before, and we implement this here. We find that using the PCF instead of PPF in the switch EM yields at least a 31% increase in all normalized decoding metrics—neural self-prediction, regime decoding, and latent state decoding—for the largest training sample size case. This improvement is attributed to PCF because both sPCF-EM and sPPF-EM use the same switch EM framework with the only difference being whether PPF or PCF is embedded in the switching filter as described in section 4.5.3. Further, the local Laplace approximation of PPF when embedded in a switching filter in sPPF-EM can even result in diverging performance as seen in figure 4(c). We verify that this is not due to overfitting as decoding metrics on even the training data diverges as seen in figure 4(k). Thus, replacing the Laplace approximation with the more accurate deterministic sampling methods of PCF in the switching filter [1] is key to enabling a successful switch EM framework for unsupervised learning. We also find that sPCF-EM outperforms the prior vLEM method [3] which embeds global Laplace in a variational EM framework [28, 29]; indeed, sPCF-EM can more than double the normalized regime decoding accuracy for certain data lengths compared with vLEM. As can be seen in figures 4(a) and (g), sPCF-EM learns parameters that yield significantly higher neural self-prediction and latent state decoding compared to vLEM across all training sample sizes with 2 ms bin sizes. Critically, we also find in figure 4(d) that sPCF-EM is more data sample efficient than vLEM, which is critical for neural datasets as training samples are often limited. Specifically, sPCF-EM is able to reach 80% of normalized regime decoding accuracy with only 100 k samples compared to 316 k samples in vLEM (see third vs. fourth clusters of figure 4(d)). Also, at 100 k samples, normalized regime decoding accuracy with vLEM is lower than 20% (figure 4(d), third cluster), suggesting that in some cases, regimes that could otherwise have been uncovered with sPCF-EM would not be found by vLEM. This data efficiency result also holds when increasing the bin size to 10 ms as shown in figure A1(b). Here, sPCF-EM reaches above 90% normalized accuracy compared to 35.3% for vLEM in the middle cluster of training samples. This result suggests that sPCF-EM maintains a data efficiency advantage over vLEM even with changes to bin size. Visualizations of these cases for both bin sizes are shown in figure 5. Overall, these results show that sPCF-EM is especially important for identifying regimes under limited data length constraints as can be the case when working with experimental brain data. These results collectively suggest that using PCF over global Laplace can improve learning, as was also seen in stationary systems. Beyond switch EM, an interesting future direction would be to explore how PCF can be incorporated into the variational EM frameworks to potentially enable higher accuracy and more data efficiency (see section 3). Visualizations of simulated data show successful decoding of latent and regime states with sPCF-EM. Spike data are binned in 2 ms and 10 ms time bins in the left and right columns, respectively; parameters are learned in both the 2 ms and 10 ms time bin cases using the same duration of data, amounting to 100 k samples and 20 k samples respectively. After parameters are learned with sPCF-EM, sPPF-EM, or vLEM in the training set, they are used in a switching PPF for test set decoding. (a)–(d) A 1 s segment from the test set of a simulated 3-regime switching system with 2 ms time bins, corresponding to 500 timesteps. (a) Ground truth and decoded regimes from the 3-regime system with each color indicating one regime. sPCF-EM’s data efficiency enables high accuracy decoding compared to sPPF-EM and vLEM. (b) Ground truth and decoded latent states (2 of the 8 latent dimensions are visualized). (c) Raster of observed spikes from 30 of the 60 simulated neurons. (d)–(f) Same visualization as (a)–(c) but for a 5 s segment from the test set of a simulated system with 10 ms time bins. As the time bins are longer, (d)–(f) also visualize 500 timesteps. We also find that the variability of performance can be further reduced by trying more initializations in sPCF-EM. Initializations can be important to help EM avoid being stuck in local maxima or saddle points [30, 35]. We thus explore increasing the number of initializations for this 100 k training sample size. We find that as we increase the number of initializations and choose the one with the best neural self-prediction within the training set, we can reduce the spread of the regime decoding accuracy such that even the 25th percentile of it exceeds 80% of the true parameter performance using 3 initializations as can be seen in figure 4(j). We repeat this procedure for vLEM with the same initializations that were used for sPCF-EM and find that while its regime decoding accuracy also improves with the number of initializations, the median performance saturates at 35% of the true parameter performance for vLEM. PCF enables learning switching dynamical systems that better predict motor cortical data and better decode movement We apply sPCF-EM to publicly available population spiking activity [41] recorded from the motor cortical areas of a monkey during a continuous 2D point-to-point reach task binned using 10 ms time bins (see figure 2 and section 4.7.1 for details on specific sessions and data sizes). First, we find that a switching dynamical system learned with sPCF-EM explains the data better than a stationary dynamical system (figure 6). To first fix the latent state dimension, we learn stationary systems for a range of latent dimensions. We find that the cross-validated median neural self-prediction reaches 99% of the peak value at a latent dimension of 10, which we fix for subsequent analyses. We then compare decoding metrics from learned stationary systems to learned switching systems with 2 regimes in a five-fold cross-validation scheme for each of the 5 experimental sessions (see section 4.7). As further increasing the number of regimes does not yield significant improvements to decoding metrics, we focus on the 2-regime case. We find that switching systems learned with sPCF-EM not only yield significantly higher neural self-prediction compared with stationary systems, but also yield a significant 8% increase in behavior decoding as seen in figures 6(a) and (b). PCF improves quality of learned parameters in experimental data for both stationary and switching system models and demonstrates the increased explanatory power of switching systems over stationary systems. Plotting conventions like bar, box, whisker, and outliers are the same as in figure 3. (a) Left shows neural self-prediction on held-out test data from parameters learned with methods listed in the legend. The first cluster is for stationary methods while the second cluster is for switching methods with the number of regimes \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{M} = 2}$\end{document}M=2. Note that all metrics within a cluster are obtained from the same filter. Right shows pairwise differences between stationary methods and their respective switching methods. Only switching systems that are learned with PCF show significant improvements in neural self-prediction over stationary systems. (b) Decoding of behavior (2D reach velocity) on held-out test data across methods. (c) Pairwise differences in neural self-prediction of test sets between sPCF-EM and either sPPF-EM or vLEM over iterations. Higher values indicate degree to which sPCF-EM outperforms sPPF-EM and vLEM. (d) Same as (c) but with pairwise differences in velocity decoding. (e) Median runtime of E-step over sweeping latent state dimension (left) and sweeping number of regimes (right). For statistical tests, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n} = 25}$\end{document}n=25, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{*}{\boldsymbol{p}} \unicode{x2A7D} 0.05$\end{document}∗p⩽0.05, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{**}{\boldsymbol{p}} \unicode{x2A7D} 0.005$\end{document}∗∗p⩽0.005, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{***}{\boldsymbol{p}} \unicode{x2A7D} 0.0005$\end{document}∗∗∗p⩽0.0005. Second, similar to our simulation results, we also find that switching systems learned with sPCF-EM outperform switching systems learned with sPPF-EM and vLEM in terms of both neural self-prediction and behavior decoding (figures 6(a) and (b)). This result holds as well for models learned on the same data but with larger 50 ms time bins, with sPCF-EM significantly outperforming both sPPF-EM and vLEM (figures A2(h) and (i)). For example, in the 10 ms time bin case, switching systems learned with sPCF-EM yield a 12% increase in velocity decoding CC over those learned with vLEM as seen in the right half of figure 6(b). These improvements in explanatory power with PCF-based methods require higher computation time as seen in figure 6(e), giving rise to a speed-accuracy tradeoff. We can attribute this increase in computational cost to the evaluations of the likelihood mean and covariance at the deterministically sampled points which scale in number polynomially with latent state dimension (see section 4.1). However, PCF-based methods have the possibility for more efficient implementations through parallelization (see Discussion) which was not the focus in this work. In exchange for this trade-off, in both simulation and experimental data, unsupervised EM learning with PCF yields higher quality parameters in terms of neural self-prediction and behavior decoding compared to prior Laplace-based methods. Further, sPCF-EM reveals behavior-relevant neural regimes that can otherwise be missed by these prior Laplace-based methods as we show next. PCF can also uncover interpretable behavior-related regimes with larger 50 ms time bins. Bar, box, whisker, outlier, and asterisk conventions are the same as in figure 6. Analyses and plot conventions for (a)–(d) are consistent with (a)–(c) of figure 7 except that the analyses in figure 7 use smaller 10 ms time bins. (a) Regime interpretation of sPCF-EM for a representative fold displaying regimes corresponding with reach magnitude. Middle panel shows median regime probability (red) time-locked to target onset and rising sharply with reach magnitude, consistent with figure 7(a) but with a coarser timescale. (b) Regime interpretation of sPCF-EM for a representative fold displaying regimes corresponding with reach direction. (c) Regime interpretation of vLEM for a representative fold, showing regimes corresponding to neither reach magnitude nor direction. (d) One of the few folds of 25 folds analyzed with vLEM that show task-relevant regimes corresponding to reach direction. (e) Scatter of magnitude metrics against direction metrics across all analyzed folds for sPCF-EM (blue dots) and vLEM (orange dots). sPCF-EM more reliably uncovers regimes that largely indicate either switches in direction or switches in magnitude compared to vLEM whose metrics are largely clustered around chance-level for both metrics. (f) Magnitude metric across folds. (g) Direction metric across folds. (h) Neural self-prediction on held-out test data for stationary (left cluster) and switching (right cluster) models across folds. Right panel shows pairwise differences between stationary methods and their respective switching methods. (i) Same as (h) but with velocity decoding. For statistical tests, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n}} = 25$\end{document}n=25, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{*}{\boldsymbol{p}} \unicode{x2A7D} 0.05$\end{document}∗p⩽0.05, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{**}{\boldsymbol{p}} \unicode{x2A7D} 0.005$\end{document}∗∗p⩽0.005, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{***}{\boldsymbol{p}} \unicode{x2A7D} 0.0005$\end{document}∗∗∗p⩽0.0005. PCF enables discovering interpretable task-relevant neural population regimes in motor cortical data We then find that despite being unsupervised with respect to behavior, sPCF-EM uncovers regimes in neural population activity that correspond to interpretable periods in the reaching behavior. As the task is continuous and self-paced, we first visualize single-trial decoded regime probabilities by time-locking the probabilities and reach velocity magnitudes to target-onset event labels per test fold (figures 7(a)–(c)). Through this, we find that several of the analyzed folds exhibit a regime pattern that corresponds to reach velocity magnitude. Empirically, one regime is dominant while the monkey is holding on the current target and until it reacts to the onset of the next target (hold regime). A second regime then has its probability sharply rise at the onset of this next target (movement regime). A representative fold is shown in figure 7(a) with additional visualizations of a continuous segment from that fold shown in figure 8. Since our method is unsupervised with respect to task or behavioral variables and just looks at neural data, we define interpretability of a decoded regime as the regime being task-relevant, i.e., interpretable in the context of the task or behavior. We thus interpret a given regime as being task-relevant when the switches in that regime correspond to changes in task-relevant behavioral variables, in this case reach magnitude. We use what we call a magnitude metric to aid in interpretation by quantifying how well a learned switching model can capture switches in reach velocity magnitude. We find this metric for each model by finding the cross-validated median decoded regime probability at target onset where movement is minimal and at 400 ms post target onset where movement is expected, and then taking the difference. For example, in figure 7(a) we find that the decoded probability is highly different between these two periods, indicating the ease with which the learned switching model could distinguish the two periods. In contrast, the regimes found with the prior vLEM did not distinguish movement vs. hold periods (figure 7(c)). Across all models learned with sPCF-EM vs. vLEM, we find that sPCF-EM is significantly more reliable in uncovering regimes with higher magnitude distinguishability as seen in figure 7(e). We also find that PCF is key to enabling the switch EM framework to uncover these magnitude regimes more reliably; this is because the magnitude metrics from sPCF-EM is significantly larger than those from sPPF-EM, which we also implemented in this work (figure 7(e)) (note sPPF-EM has not been shown in prior work). One of the representative folds of sPPF-EM that fails to identify a magnitude regime is shown in figure A3(e). PCF enables uncovering interpretable behavior-related neural regimes, completely unsupervised with respect to behavior. Bar, box, whisker, outlier, and asterisk conventions are the same as in figure 6. (a) Regime interpretation of sPCF-EM for a single representative fold. Uncovered regimes correspond with reach magnitude. Left panel shows single-trial regime probabilities and reach velocity magnitudes from held-out test fold time locked to target onset with values indicated by their respective color bars. Note that the signals are continuous when not time locked. Middle panel overlays median regime probability (red) over median reach magnitude (black). For this fold, regime probability sharply rises on target onset and yields a difference in probability of 0.492 at 400 ms post onset vs. at onset. This metric will be called the magnitude metric as described in the text. Right panel shows a scatter of average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{x,y}}$\end{document}x,y velocity during the period of expected movement per trial (200–600 ms post target onset) over the entire session. Points are labeled by most likely regime over the same period (regime with highest average decoded probability over 200–600 ms). Most points in this movement period are associated with regime 2 (red), showing regime 2’s relevance to movement. (b) Same analyses as in (a) from sPCF-EM but for a representative fold with regimes corresponding with reach direction. Right panel shows clear separation between labeled regimes with AUC of 0.971. This AUC will be called the direction metric as described in the text. Regimes separate to discriminate a top-right direction vs. a bottom-left direction, with the most discriminant linear boundary overlayed in magenta. (c) Same analyses as in (a, b) but for a representative fold using vLEM. Regimes describe neither reach magnitude nor reach direction, indicating the vLEM does not learn interpretable task-relevant regimes. (d) Scatter of magnitude metrics against direction metrics across all analyzed folds for sPCF-EM and vLEM. Representative folds of panels a and b are highlighted with magenta triangles and representative fold of panel c is shown with a magenta square. sPCF-EM reliably uncovers regimes that largely indicate either switches in direction or switches in magnitude. For vLEM, learned regimes describe neither reach magnitude nor direction across all analyzed folds. (e) Magnitude metric across folds. (f) Direction metric across folds. (g) Regime separation boundaries as in the right panel of (b) for all folds using sPCF-EM with high direction metric (AUC > 0.8). Bottom shows the histogram of the angles of these boundaries. Regimes that describe reach direction consistently yield a top-right and bottom-left separation boundary with a mean boundary angle of 145.7°. For statistical tests, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n}} = 25$\end{document}n=25. Visualization of a continuous segment of experimental data showing switches in decoded regimes learned by sPCF-EM, which correspond to changes in reach velocity magnitude. (a) Example decoded regime probabilities using parameters learned from each switching method: sPCF-EM, sPPF-EM, and vLEM. In these analyses, all methods have a total of two regimes. Magenta lines indicate target onset times. White patches indicate that regime 1 is decoded and colored patches indicate that regime 2 is decoded. For vLEM (orange), its two regimes describe the activity during this window roughly similarly, resulting in probabilities that do not confidently switch towards 0 or 1 for either regime. sPPF-EM (green) fails to identify a second regime for this fold and thus its decoded probability of regime 2 remains largely at 0. Velocity decoding would then be expected to perform similarly to a stationary system with the first regime’s parameters. (b) Magnitude of reach velocity over the same segment as in (a). Blue patches that correspond to decoded regime 2 from sPCF-EM largely correspond to increases in reach velocity magnitude as first explored in figure 7(a), showing that sPCF-EM can identify magnitude-related regimes. In comparison, orange patches that correspond to decoded regime 2 from vLEM are not magnitude-related. (c) Raster plot of multiunit activity over the same segment as (a). (d) Ground truth and decoded reach velocity traces for x and y reach velocity. Blue patches show the decoded regime 2 from sPCF-EM. Bottom panel reproduces the decoded regimes from vLEM for ease of visualization and is identical to the bottom panel of (a). sPPF-EM can be unreliable in uncovering behavior-related regimes. Bar, box, whisker, outlier, and asterisk conventions are the same as in figure 6. Analyses and plot conventions for (d)–(f) are consistent with (a)–(c) of figure 7 with all three panels visualizing folds from sPPF-EM. (a) Scatter of magnitude metrics against direction metrics across all analyzed folds for sPCF-EM (blue dots) and sPPF-EM (green dots). Unlike sPCF-EM, sPPF-EM fails at identifying magnitude regimes while it can identify direction regimes similar to sPCF-EM. (b), (c) Magnitude and direction metrics across folds for sPCF-EM and sPPF-EM as reproduced from figures 7(e) and (f). (d) Regime interpretation of sPPF-EM for a representative fold displaying regimes corresponding with reach direction. (e) Regime interpretation of sPPF-EM for a representative fold displaying regimes that fail to capture switches in either direction or magnitude. Parameters learned with sPPF-EM can result in one regime being dominant such as regime 1 here. (f) There was a single outlier fold from sPPF-EM with a larger magnitude metric; however, even this outlier fold did not consistently indicate switches in magnitude across trials as can be seen by the much wider shaded area around the median regime probability in the middle panel here compared with that in figure 7(a) (shaded area represents 25th to 75th percentile of decoded regime probability across trials). For statistical tests, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{n}} = 25$\end{document}n=25, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${}^{**}{\boldsymbol{p}} \unicode{x2A7D} 0.005$\end{document}∗∗p⩽0.005. Interestingly, for folds where the uncovered regimes did not clearly correlate with reach velocity magnitude, sPCF-EM instead uncovered regimes that better correspond to reach direction. To show this, we decode the regimes in the entire session using the learned parameters per training set and focus on the 200 ms to 600 ms movement period post target onset where reaches are expected. This window is chosen because the median increase in velocity magnitude is centered on this window as exemplified by the gray traces in the central panels of figures 7(a)–(c). We then find the average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $x$\end{document}x, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $y$\end{document}y velocity in each trial in that period. We also separately label each trial by the regime with the highest average decoded probability in that time period which we emphasize was found unsupervised with respect to behavior. We then provide the scatter plot for the average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $x$\end{document}x, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $y$\end{document}y velocity and label each point by the decoded regime. As shown in the rightmost panel of figure 7(b), we find that the decoded regimes can be clearly differentiated by average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $x,y$\end{document}x,y velocity. We also find that sPPF-EM is capable of identifying similar regimes with a representative fold shown in figure A3(d), although we emphasize that sPPF-EM fails to identify magnitude regimes unlike sPCF-EM (figures 7(e) and A3(a), (b)). Here, reaches in the bottom-left direction were largely identified as one regime by sPCF-EM (bottom-left regime) compared to reaches in the top-right direction (top-right regime). We use what we call a direction metric to quantify how well a learned switching model can capture switches in reach direction. This metric is based on the differentiability of the decoded regimes by average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $x,y$\end{document}x,y velocity. We find this metric by calculating the mean AUC from an LDA classifier that predicts the decoded regime from average \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $x,y$\end{document}x,y velocity over five folds. Here, an AUC of 0.5 indicates chance while 1 indicates perfect linear differentiability. We find the median AUC over the 25 models to be 0.92 with 10 of the 25 reaching above 0.95 AUC as shown in figures 7(d) and (f). Further, for models with AUC’s above 0.8, we find that the regimes do not discriminate arbitrary directions but rather they consistently discriminate a to p-right and bottom-left pattern as shown in figure 7(g). This result may suggest a consistent regime pattern in neural population dynamics that across all sessions distinguishes reaches towards the body versus away from the body. Further, we find that the ability for sPCF-EM to uncover regimes is not dependent on the size of the time bins used in our analyses. More specifically, we replicated the above regime interpretation analyses in figure A2 but on models learned on data binned in 50 ms windows, which are five times larger than those used for figure 7. As illustrated in figure A2, even with larger time bins, sPCF-EM is able to uncover task-relevant regimes while being unsupervised. Here, representative folds in figures A2(a) and (b) illustrate regimes that correspond to reach magnitude and reach direction, respectively. The single-trial decoded probabilities in the left panels of figures A2(a) and (b) are also visually similar to those in figures 7(a) and (b), but with a coarser timescale due to the increased time bin size. The results of the larger bin size illustrate how sPCF-EM can flexibly extend to other time bin sizes because it is derived for a Poisson observation modality that allows for multiple spikes per bin. Finally, we find that models from the prior vLEM method are significantly less reliable in capturing switches in either direction or magnitude in these experimental datasets regardless of time bin size. As seen in figures 7(e) and (f) for the 10 ms time bins, both direction and magnitude metrics for vLEM across all analyzed folds are clustered at chance level with a representative fold shown in figure 7(c). With the larger 50 ms time bins, the direction and magnitude metrics from vLEM across all folds are still significantly lower than those from sPCF-EM and are still clustered around chance level (figures A2(f) and (g)) with a representative fold shown in figure A2(c). Indeed, even in this larger time bin case for vLEM, the vast majority of folds had their direction and magnitude metrics around chance (figures A2(c), (f) and (g)) with just a few folds showing regimes corresponding to reach direction (see one such fold in figure A2(d)). This result suggests that vLEM is less reliable than sPCF-EM in identifying task-relevant regimes in these datasets. This result can be due to the sample efficiency of sPCF-EM compared with vLEM, which we also saw in simulations (figures 4(d) and A1(b)). While vLEM can be successful in decoding regimes in simulations (section 2.3), it needed substantially more training samples to do as well as sPCF-EM as seen in figure 4(d). Further, even when changing the bin size for the same duration of data, sPCF-EM still outperforms vLEM as seen in the 2nd cluster of figure A1(b). Together, these results suggest that sPCF-EM can be successful but vLEM can have difficulty in regime identification for the duration of data per session in these experimental datasets (section 4.7.1), similar to what we found in simulation. However, we emphasize that with sufficient data, vLEM is still a powerful tool and also offers good computational efficiency. Future work could investigate an integrated framework which can collectively leverage the individual benefits of PCF-based learning and variational methods. Discussion With the goal to enable accurate unsupervised learning of switching or stationary dynamical systems from Poisson observations, we developed a novel deterministic sampling filter for Poisson observations called the PCF to be used for EM learning. PCF includes novel derivations to enable an MMSE estimation approach using Poisson observations. It uses numerical integration techniques using a spherical–radial cubature rule to generate deterministic samples for estimating the necessary MMSE terms. We demonstrated how PCF can enable EM frameworks for accurate unsupervised learning of stationary (PCF-EM) and switching (sPCF-EM) dynamical systems using only Poisson spiking activity. We found that PCF enables more accurate learning of both stationary and switching dynamical systems compared with prior methods, thus largely improving the neural self-prediction, behavior decoding, and regime decoding in both simulations and motor cortical data from the primate brain during reaching movements. Also, (s)PCF-EM is more data-efficient than prior learning methods, which is important for experimental datasets. Finally, sPCF-EM enabled discovering regimes in the motor cortical population activity that were interpretable and behavior-relevant despite being learned fully unsupervised with respect to behavior. These interpretable neural population regimes were not found by prior learning methods. We first validated the methods using numerical simulations. In stationary systems, we showed that parameters are successfully learned by PCF-EM and approach ground truth model parameters. We also showed that PCF-EM significantly outperforms prior methods that use the Laplace approximation. For switching systems, parameters are again successfully learned and the gain from sPCF-EM over prior methods is even greater compared with the stationary case. To show that successful learning depends on the PCF, we also implemented an EM framework with the PPF and showed that it significantly underperforms the PCF-based EM. Moreover, sPCF-EM can outperform the prior vLEM method, and importantly can better identify regimes at lower training sample sizes, i.e., sPCF-EM is more data-efficient. Numerical simulations gave us additional tools to probe the developed methods as true latent states, regime states, and model parameters are known in simulations. Prior works have similarly used simulated data to develop new methods for biotechnologies and neural engineering [1, 3, 15, 20, 23, 46–60]. PCF’s ability to enable the unsupervised learning of switching systems lends itself to multiple potential applications. For brain–machine interfaces (BMIs) whose goals are to restore lost motor function [19, 57, 58, 61–64], learning with sPCF-EM can improve the real-time decoding performance compared to stationary methods as we found in our results. Additionally, sPCF-EM could also be a valuable tool in the study of internal/mental states and how they impact behavior. Prior work has shown that changes in mental states such as stress, engagement, and attention can lead to changes in how subjects perform tasks and that these mental changes can be described with regimes [8, 65, 66]. However, in many cases, accurate and frequent labels of mental states may not be available. Unsupervised methods like sPCF-EM are potential tools to learn different regimes that could correlate with different mental states using just neural activity and without mental state labels for supervised training. Further, in the context of mental disorders, the learned switching models could be paired with causal switching filters to detect switches into regimes of aberrant activity in real-time and enable personalized therapies such as with deep brain stimulation [59, 62, 67–69]. The unsupervised discovery of regimes enabled by PCF-based EM can also serve as a tool to facilitate basic neuroscience investigations into neural population dynamics. For example, we found that there exist regime switches in motor cortical dynamics that may correspond to hold vs. movement and to movements toward vs. away from the body. These regimes were found fully unsupervised with respect to behavior yet were behavior-relevant and interpretable. Also, these regimes were more reliably found by PCF-based EM and were largely not found by the prior vLEM method, likely due to PCF-based EM’s data efficiency. Thus PCF-based EM provides a tool for basic neuroscience investigations. The improvements to switch learning that PCF enables was driven by a transition from the Laplace-based approximations to deterministic sampling-based approximations. This was evident from substantial improvements over the same EM framework that instead of PCF used the widely used PPF which utilizes the Laplace approximation for Poisson observations. While global Laplace methods could outperform the local approach of PPF, PCF-based methods were still largely more accurate in learning. We hypothesize that this improvement was due to the general property of Laplace approximation not being able to always accurately capture first and second moments due to focusing on a single point, whereas deterministic sampling methods use multiple points to approximate second moment terms. However, a topic for future work would be to theoretically characterize the degree of inaccuracy in second moment terms and how much this impacts learning. As discussed in sections 2.1 and 4.2, deterministic sampling-based non-linear filters like the UKF and CKF are widely used [30, 37, 39, 45, 70–72] but cannot be directly applied to Poisson observations, thus requiring a novel filter to be developed from a fundamental MMSE approach to properly incorporate Poisson observations which are nonconjugate with the Gaussian latent state. While we performed the derivation for Poisson observations, the derivation is general with the only requirement being that the likelihood mean and covariance of the observation modality given the latent state is known and can be evaluated. Future work could then explore extending this derivation on other observation modalities that do not fit traditional non-linear filters, such as the Bernoulli observations, and develop deterministic sampling-based methods for these modalities. For the Bernoulli modality, recent work has also explored using the Polya–Gamma augmentation to enable conditionally conjugate inference [47, 73]. Thus, future work on deterministic sampling-based methods for Bernoulli observations can compare its learning performance with that from methods that use the Polya–Gamma augmentation. Our results in both simulated and experimental data show how PCF-based learning methods can yield high accuracy parameter estimates. However, there are additional future directions of extensions apart from the above two to advance these methods. First, a known general problem with EM-based learning methods is that they can converge to local instead of global maxima [30, 35, 74]. For learning methods for switching systems, this can manifest as regimes not being properly identified especially with insufficient data as seen for vLEM in our experimental results and for all methods in our simulation results with the shortest training sample size. While we showed and used a simple process of randomly initializing multiple times to improve consistency, future work could investigate more principled approaches to initialization, including but not limited to deterministic annealing [30, 35, 75]. Second, while we found that the PCF-based methods were more accurate than prior methods, there was a trade-off in terms of computational efficiency with the prior vLEM method performing significantly faster. Nevertheless, our use of a spherical–radial cubature rule in PCF instead of Gauss–Hermite quadrature (GHQ) rule does enable polynomial scaling instead of exponential scaling with latent state dimension as described in section 4.1. Further, at lower state dimensions, PCF’s runtime was comparable to that of PPF. As the PCF method involves independent evaluations of the same few functions over many deterministically sampled points before taking weighted sums, implementations that can more efficiently parallelize these evaluations could see meaningful reductions in runtime in the future. Third, while PCF was embedded in a switch EM framework here, future work could also explore using PCF in a variational learning framework, which may have potential benefits such as improved computational efficiency. Fourth, the model assumed for this work uses linear dynamics which offers benefits like interpretability, computational efficiency in both learning and inference, data efficiency, and extensions to real-time applications [2, 14, 19, 20, 61, 62, 67–69, 76–80]. Extending to switching linear dynamics, as we do here, can increase explanatory power and approximate nonlinearities while maintaining the above benefits of linear dynamical systems given that dynamics per regime are kept linear. Future work can explore extending the model and the associated learning methods to those with non-linear dynamics per regime to further increase explanatory power, though doing so may lead to a tradeoff in terms of interpretability or computation and data efficiency. Finally, our results show how replacing the Laplace approximation in a causal filter with deterministic sampling can lead to improvements in learning, especially for switching systems. However, causal filters using the Laplace approximation are still valuable tools. First, we used PCF just for learning. Once model parameters are learned, we can use the faster filters based on Laplace approximation for decoding purposes with the learned parameters. For stationary systems, PPF that uses the Laplace approximation is known to be quite efficient and even implemented in real-time BMIs for millisecond-by-millisecond control and feedback [13, 48, 80–84]. For switching systems, recent work developed a switching filter that uses Laplace approximation [1] and showed that, once parameters are known, this filter can successfully perform causal decoding. Indeed, all decoding metrics in this work, once parameters are learned, use filters with Laplace approximation [1, 13, 16]. Thus, Laplace approximation-based filters serve as valuable companion methods to the developed PCF-based learning methods of this work, especially in the context of real-time decoding applications once parameters are learned with PCF-based learning. Taken together, we developed PCF-based EM frameworks that achieve accurate unsupervised learning of stationary and switching dynamical system models from Poisson observations with both basic science and neurotechnology applications. Methods In this section, we introduce the tool of numerical integration based on cubature rules and provide details on how we use it in our approach to deriving the novel PCF. We then show how PCF can be embedded in unsupervised learning frameworks for both stationary and switching dynamical systems with figure 1 serving as a visual summary. We finally detail the validation methods including performance metrics, simulated data setup, and applications of our methods on experimental data. Background: numerical integration based on spherical–radial cubature rules We first briefly introduce the tool of numerical integration which we use to approximate important terms when deriving the PCF (see references in [37–39] for details). Numerical integration tools approximate solutions to complex integrals with weighted sums over a sparse set of points. One use case of this is to approximate expected values of functions of Gaussians since expected values of Gaussians are integrals over the Gaussian probability distribution. For PCF, we use the 5th-degree spherical–radial cubature rule of [38] to deterministically generate weights and points. As provided in [38], for a Gaussian random variable \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\mathbf{X}} \in {\mathbb{R}^{\boldsymbol{d}}}$\end{document}X∈Rd with mean and covariance \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{\unicode{x03BC}}}$\end{document}μ and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} ${\boldsymbol{\Lambda }}$\end{document}Λ, the expected value of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $g\left( {\mathbf{X}} \right)$\end{document}gX where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} $g\left( \cdot \right)$\end{document}g⋅ is an arbitrary function can be approximated as: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{upgreek} \usepackage{mathrsfs} \setlength{\oddsidemargin}{-69pt} \begin{document} \begin{align*}\begin{array}{*{20}{l}} {{E_{\mathbf{X}}}\left[ {g\left( {\mathbf{X}} \right)} \right] \approx \mathop \sum \limits_{i = 1}^{2{d^2} + 1} {w_i}g\left( {{\boldsymbol{\unicode{x03BC}}} + \sqrt {\boldsymbol{\Lambda }} {{\boldsymbol{\xi }}_i}} \right)} \\[3pt] {{w_1} = \frac{2}{{d + 2}}} \\[3pt] {{w_{2:2d + 1}} = \frac{{4 - d}}{{2{{\left( {d + 2} \right)}^2}}}} \\[3pt] {{w_{2d + 2:2{d^2} + 1}} = \frac{1}{{{{\left( {d + 2} \right)}^2}}}} \\[3pt] {{{\boldsymbol{\xi }}_1} = \boldsymbol{0}} \\[3pt] {{{\boldsymbol{\xi }}_{2:2d + 1}} = \left\{ { \pm \sqrt {d + 2} \cdot {{\mathbf{e}}_j}:j = 1,2, \ldots ,d{\text{ }}} \right\}} \\[3pt] {{{\boldsymbol{\xi }}_{2d + 2:2{d^2} + 1}}}\\[3pt] { \quad = \left\{ { \pm \sqrt {d + 2} \cdot \frac{1}{{\sqrt 2 }}\left( {{{\mathbf{e}}_k} \pm {{\mathbf{e}}_l}} \right):k < l,k,l = 1,2, \ldots ,d{\text{ }}} \right\}\!.} \end{array}\end{align*}\end{document}EXgX≈∑i=12d2+1wigμ+Λξiw1=2d+2w2:2d+1=4−d2d+22w2d+2:2d2+1=1d+22ξ1=0ξ2:2d+1=±d+2⋅ej:j=1,2,…,d ξ2d+2:2d2+1=±d+2⋅12ek±el:k