Skip to main content
Advertisement

< Back to Article

Fig 1.

Flowchart of the variational Bayesian learning as an instance of generalized EM algorithm.

M Gaussian SSMs, indexed by m ∈ {1, ⋯, M}, is parameterized by and augmented with an HMM parameterized by ρ and ϕ. The HMM determines the switching among the Gaussian SSMs to produce observed data. The observations are corrupted by observation noise with covariance R and indexed by t ∈ {1, ⋯, T}. We introduce and , two variational summary statistics, to approximate the true posterior distribution p with a different distribution q. The E-step requires inference of the hidden states, achieved through fixed-point iterations that improve the variational approximation incrementally. Once the E-step has stabilized, model parameters are updated in the M-step. The convergence of the inner (E-step) iterations and outer (EM) iterations, index by i, is checked using the negative variational free energy . This algorithm outputs 1) posterior estimates of model parameters, , 2) state inferences, i.e., the means and covariances of Gaussian SSM hidden states, and , and 3) estimates of M model probabilities of generating the observation at each time point, .

More »

Fig 1 Expand

Fig 2.

Simulation results: Segmentation performance when true parameters are known.

(a) An example simulated sequence switching between two AR1 models with different dynamics. The top panel shows the time trace with the two states marked in different colors. The bottom panel shows switching inference results on this example given true parameters of the underlying generative model. Time points estimated to be in the first model (st = 1) are marked in colored dots for each inference method, with accuracy shown in parentheses. (b) Histograms of segmentation accuracy across 200 repetitions. The mean segmentation accuracy for each method is displayed and marked by the dashed red line. True = ground truth; Random = random segmentation with a Bernoulli process; Static = static switching method; IMM = interacting multiple models method; VI-A = variational inference with deterministic annealing (orange color); VI-I = variational inference with interpolated densities (blue color).

More »

Fig 2 Expand

Fig 3.

Simulation results: Segmentation performance when true parameters are unknown.

(a) Histograms of segmentation accuracy across 200 repetitions of sequences of 200 time points. Since the true parameters were not known, they were estimated using an instance of EM algorithm for VI-A and VI-I inference starting from a random initialization. Static switching and IMM treated those random initialization as true model parameters. The mean segmentation accuracy for each method is displayed and marked by the dashed red line. The mean accuracy previously obtained using true parameters is shown in gray. Random = random segmentation with a Bernoulli process; Static = static switching method; IMM = interacting multiple models method; VI-A EM = variational EM learning with deterministic annealing (orange color); VI-I EM = variational EM learning with interpolated densities (blue color). (b) Swarm plots showing the distributions of model parameters learned by the variational learning algorithms for sequences of 200 time points. Uniform distributions used to sample initial parameters are marked in bold fonts on the y-axes, as well as using solid black lines (true values) and dotted gray lines (upper and lower bounds of the ranges). (c) Changes of mean segmentation accuracy over sequences of varying data lengths. Shaded bounds denote the standard error of the mean around the average accuracy values. (d) Mean parameter estimation errors from the true values across 10 EM iterations for two different data lengths. For transition matrix F and state noise variance Q, normalized error is defined as abs(estimated—true)/true, and averaged across the two switching models. Absolute error is defined as abs(estimated—true). Shaded bounds denote the standard error of the mean around the average error values.

More »

Fig 3 Expand

Fig 4.

Simulation results: Example segmentation on data generated from a different switching model class when true parameters are known.

The top two panels show the two sequences, y1 and y2, recorded as a bivariate observation y. Sequence y2 has a non-zero influence on sequence y1 as shown by the upward arrows, according to a switching state st. The time traces are also marked with different colors for the two switching states. The bottom panel shows the results of switching inference on the example data given true parameters. Time points estimated to be in the first model (st = 1) are marked in colored dots for each inference method, with accuracy shown in parentheses. True = ground truth; Random = random segmentation with a Bernoulli process; Static = static switching method; IMM = interacting multiple models method; VI-A = variational inference with deterministic annealing (orange color); VI-I = variational inference with interpolated densities (blue color).

More »

Fig 4 Expand

Fig 5.

Simulation results: Segmentation performance on data generated from a different switching model class.

(a) Histograms of segmentation accuracy given true parameters across 200 repetitions. (b) Histograms of segmentation accuracy when model parameter were unknown across 200 repetitions. We followed the same strategy stated in Fig 3 when the true model parameters were not available. In both (a) and (b), the mean segmentation accuracy for each method is displayed and marked by the dashed red line. Random = random segmentation with a Bernoulli process; Static = static switching method; IMM = interacting multiple models method; VI-A = variational inference with deterministic annealing (orange color); VI-I = variational inference with interpolated densities (blue color). VI-A/VI-I EM denote the EM learning algorithms with the corresponding initialization procedure during E-steps.

More »

Fig 5 Expand

Fig 6.

Simulation results: Segmentation performance on switching state-space oscillator models when true model parameters are known.

(a) Power spectra of simulated oscillations at different frequencies; spectral estimation obtained via multitaper method that utilized 6 tapers corresponding to a time half-bandwidth product of 4. (b) Changes of mean segmentation accuracy over the number of switching states, as the number of underlying oscillations varies between 2 and 5. Shaded bounds denote the standard error of the mean around the average accuracy values across 200 repetitions. (c) An example switching state path with 5 underlying oscillations and 31 possible switching states. (d) Estimated switching states with variational inference. VI-A = variational inference with deterministic annealing (orange color); VI-I = variational inference with interpolated densities (blue color).

More »

Fig 6 Expand

Fig 7.

Real-world example: Comparisons of switching inference algorithms for sleep spindle detection.

(a) In the top three panels, the spindle activity is visualized using a spectrogram, the original time trace, and after being bandpass filtered within 10 Hz–16 Hz. The fourth panel shows the posterior model probabilities of st = 1 estimated by variational EM learning with interpolated densities (VI-I EM, blue color). The margins of spindle events identified by VI-I EM are also marked with vertical dashed lines. The last two panels display the estimated real (blue) and imaginary (magenta) spindle waveforms with 95% confidence intervals from posterior covariances. The learned spindle center frequency is displayed in blue in parentheses. (b) Estimated posterior model probabilities of st = 1 by other algorithms in comparison. A model probability closer to 1 suggests the presence of spindles (S = Spindle), while being closer to 0 indicates no spindle (NS = No Spindle). The 0.5 model probability is marked with gray horizontal dashed lines. VI-A EM = variational EM learning with deterministic annealing (orange color); Static = static switching method; IMM = interacting multiple models method; S&S 1991 = the Gaussian merging method in [34].

More »

Fig 7 Expand

Fig 8.

Automatic segmentation of sleep spindles using the VI-I EM method.

Three 30 s EEG recordings of NREM-2 sleep were segmented with the variational EM learning method with interpolated densities (VI-I EM) to identify spindles in an unsupervised manner. In each of the (a)-(c) recordings, the three sub-panels visualize spindle activity using a spectrogram, the original time trace, and the estimated real part of spindle waveform with 95% confidence intervals from posterior covariances. The learned spindle center frequencies are displayed in blue in parentheses. The estimated posterior model probabilities for the candidate model with both slow oscillations and spindles are overlaid on the time traces in blue lines. Shaded pink bars indicate spindles identified by a wavelet-based method for comparison. S = Spindle; NS = No Spindle.

More »

Fig 8 Expand

Fig 9.

Generative structure with parallel switching state-space models.

A directed acyclic graph is shown to represent the conditional independence structure between the M real-valued Gaussian hidden state sequences for m ∈ {1, ⋯ M}, a discrete-valued hidden Markov chain {st}, and the observed data {yt} up to time T. In this generative structure, the observation at a given time point depends only on the hidden states of the M Gaussian models at that point, with the discrete-valued state selecting one of the models to produce the observation, hence the name switching.

More »

Fig 9 Expand

Fig 10.

Posteriors of switching state-space models.

(a) True posterior distribution. This is the resultant graph encoding the conditional independence relation after conditioning on the observed data {yt} up to time T. The new edges between the hidden states make exact inference intractable. (b) Approximate posterior distribution. Compared to the true posterior, a structured approximation decouples the hidden Gaussian state-space models from each other and from the switching state. On this approximate distribution, efficient closed-form inference can be performed. The marginal distributions of the Gaussian hidden states {xt} and the discrete-valued switching state {st} are now inter-dependent through variational summary statistics and .

More »

Fig 10 Expand