Abstract
In this chapter, we will consider a more complicated form of the state equation—one that contains both a forgetting factor and an external input. We will also extend the earlier state-space model to the case where we now have one binary observation and two continuous observations. As before, however, we will first consider a scenario motivating the need for such a state-space model.
You have full access to this open access chapter, Download chapter PDF
In this chapter, we will consider a more complicated form of the state equation—one that contains both a forgetting factor and an external input. We will also extend the earlier state-space model to the case where we now have one binary observation and two continuous observations. As before, however, we will first consider a scenario motivating the need for such a state-space model.
Recall the example two chapters ago concerning the estimation of sympathetic arousal from skin conductance features. In reality, it is not just the rate of occurrence of neural impulses to the sweat glands that reflects changes in arousal. Other features in a skin conductance signal also contain arousal information. A skin conductance signal comprises a fast-varying phasic component superimposed on top of a slower-varying tonic component. The phasic component consists of all the SCRs. The amplitudes of these SCRs (or equivalently, the amplitudes of the neural impulses that generated them), in addition to their occurrence, also reflect changes in arousal [59]. In particular, larger SCRs reflect greater sympathetic arousal. Additionally, the tonic level also contains information regarding general arousal [60]. Thus, there are three primary sources of information in a skin conductance signal that capture arousal levels: (i) the occurrence of SCRs (or equivalently the occurrence of the neural impulses that generated the SCRs); (ii) the amplitudes of the SCRs (or the amplitudes of the neural impulses); (iii) the tonic component. These three make up one binary feature and two amplitude (continuous) features. A state-space model based on these three features was developed in [29], for estimating arousal from skin conductance. Here, a transformed version of the SCR amplitudes was interpolated over to derive the first continuous variable, and the tonic component was considered the second continuous variable. Different algorithms are available for separating out the tonic and phasic components in a skin conductance signal (e.g., [61, 62]).
A further note is also worth mentioning here. Recall the \({\mathbf {u}}_{k}\) term in our discussion of state-space models at the beginning. Thus far, we have not yet considered a model where an external input also drives the state \(x_{k}\). In reality, external circumstances and environmental inputs all affect the way we feel. The model in [29] included such an external input term \(I_{k}\). The model was evaluated on two experimental datasets, one of which involved a Pavlovian fear conditioning experiment. In typical fear conditioning experiments, a neutral cue is paired with an unpleasant stimulus such as a painful electric shock. Through repeated pairing, the neutral cue alone begins to elicit a physiological response that is typically seen for the unpleasant stimulus [63]. In fear conditioning experiments, the unpleasant stimulus could also take other forms such a blast of air to the throat, an aversive image, or a loud sound [64, 65]. In [29], the neutral cues along with the unpleasant shocks were modeled as binary-valued indicator inputs \(I_{k}\) that drove the sympathetic arousal state \(x_{k}\).
5.1 Deriving the Predict Equations in the State Estimation Step
Let us now turn our attention to the state-space model itself and assume that \(x_{k}\) evolves with time as
where \(\alpha \) is a constant and \(I_{k}\) is an external input. The other terms have their usual meanings. Let us again consider how we may derive the mean and variance using basic statistical formulas. Since we know what the external input is, we do not treat it as a random variable but rather as a constant term. We first consider the mean.
We next consider the variance.
When \(x_{k}\) evolves with time following \(x_{k} = \rho x_{k - 1} + \alpha I_{k} + \varepsilon _{k}\), the predict equations in the state estimation step are
5.2 Deriving the Update Equations in the State Estimation Step
In this state-space model, we include a second continuous variable \(s_{k}\). Similar to \(r_{k}\), we will assume that \(s_{k}\) too is linearly related to \(x_{k}\) as
where \(\delta _{0}\) and \(\delta _{1}\) are constants and \(w_{k} \sim \mathcal {N}(0, \sigma ^{2}_{w})\) is sensor noise. Similar to the case of \(r_{k}\) in (4.16), we also have
The procedure to derive the update equations in the state estimation step is now similar to what we have seen earlier. With \(s_{k}\) included, we have yet another exponent term in \(p(x_{k}|y_{1:k})\). Therefore,
Taking the log on both sides, we have
Taking the first derivative of q and setting it to 0 yield
We used a trick in the previous chapter to solve for \(x_{k}\). We added and subtracted \(\gamma _{1}x_{k|k - 1}\) to the term containing \(r_{k}\). We will do the same here. We will also add and subtract \(\delta _{1}x_{k|k - 1}\) to the term containing \(s_{k}\).
Therefore,
This yields the state update
Likewise, the second derivative yields
And therefore,
When \(x_{k}\) gives rise to a binary observation \(n_{k}\) and two continuous observations \(r_{k}\) and \(s_{k}\), the update equations in the state estimation step are
5.3 Deriving the Parameter Estimation Step Equations
In this state-space model, we have the parameters \(\alpha \), \(\rho \), \(\gamma _{0}\), \(\gamma _{1}\), \(\delta _{0}\), \(\delta _{1}\), \(\sigma ^{2}_{v}\), and \(\sigma ^{2}_{w}\) to determine. We have already seen how \(\gamma _{0}\), \(\gamma _{1}\), and \(\sigma ^{2}_{v}\) were derived in the previous chapter when we had \(r_{k}\). We will not repeat those derivations here again. Instead, we will only consider the derivations related to the new model parameters or changes to the way that earlier model parameters were derived. We will use this same approach of not re-deriving previous equations in the chapters that follow as well.
5.3.1 Deriving the Terms in the State Equation
We now have both \(\rho \) and \(\alpha \) in the state equation. To determine them at the parameter estimation step, we will take the partial derivatives of the log-likelihood term containing \(\rho \) and \(\alpha \). In this case, the term we are interested in is
Again, we set \(x_{0} = x_{1}\) to permit some bias at the beginning and ignore the relationship through \(\rho \) for this boundary condition. Therefore,
We will now take the partial derivatives of \(Q_{1}\) with respect to \(\alpha \) and \(\rho \) and set them to 0. Let us first begin with \(\alpha \).
We will next take the partial derivative of \(Q_{1}\) with respect to \(\rho \).
We now have two equations with which to solve for \(\alpha \) and \(\rho \).
The parameter estimation step updates for \(\rho \) and \(\alpha \) when \(x_{k}\) evolves with time following \(x_{k} = \rho x_{k - 1} + \alpha I_{k} + \varepsilon _{k}\) are
5.3.2 Deriving the Process Noise Variance
We next consider the parameter estimation step update for the process noise variance \(\sigma ^{2}_{\varepsilon }\). The log-likelihood term containing \(\sigma ^{2}_{\varepsilon }\) is
We take the partial derivative of \(Q_{2}\) with respect to \(\sigma ^{2}_{\varepsilon }\) and set it to 0 to solve for the parameter estimation step update.
The parameter estimation step update for \(\sigma ^{2}_{\varepsilon }\) when \(x_{k}\) evolves with time following \(x_{k} = \rho x_{k - 1} + \alpha I_{k} + \varepsilon _{k}\) is
5.3.3 Deriving the Constant Coefficient Terms and the Sensor Noise Variance
The procedure for deriving the constant coefficients \(\delta _{0}\) and \(\delta _{1}\) related to \(s_{k}\) is similar to what we have seen earlier for \(\gamma _{0}\) and \(\gamma _{1}\). The derivation of the sensor noise variance \(\sigma ^{2}_{w}\) is also similar to that for \(\sigma ^{2}_{v}\).
The parameter estimation step updates for \(\delta _{0}\), \(\delta _{1}\), and \(\sigma ^{2}_{w}\) when we observe a second continuous variable \(s_{k} = \delta _{0} + \delta _{1}x_{k} + w_{k}\) are
5.4 MATLAB Examples
The code examples implementing the EM algorithm for the current state-space model are provided in the “one_bin_two_cont∖sim” and “one_bin_two_cont∖expm” folders. These two directories contain the following files:
-
one_bin_two_cont∖
-
sim∖
-
data_one_bin_two_cont.mat
-
filter_one_bin_two_cont.m
-
data_one_bin_two_cont_no_extern_stim.mat
-
filter_one_bin_two_cont_no_extern_stim.m
-
-
expm∖
-
expm_data_one_bin_two_cont.mat
-
expm_filter_one_bin_two_cont.m
-
expm_data_one_bin_two_cont_no_extern_stim.mat
-
expm_filter_one_bin_two_cont_no_extern_stim.m
-
-
For both simulated and experimental data, we have provided examples with and without \(\alpha I_{k}\) (the external input). Results from running the code on a simulated example with \(\alpha I_{k}\) included and on an experimental data example without \(\alpha I_{k}\) are shown in Fig. 5.1. For simulated and experimental data containing \(\alpha I_{k}\), the “.m” files are named “filter_one_bin_two_cont.m” and “expm_filter_one_bin_two_cont.m,” respectively. The corresponding examples without \(\alpha I_{k}\) have the “no_extern_stim” suffix added to them.
In this case, the model takes in as inputs the variables n, r, and s that denote \(n_{k}\), \(r_{k}\), and \(s_{k}\), respectively, for estimating \(x_{k}\). Since there are three different observations, the code also has more parameters to initialize. In the code, the variables r0 and r1 are used for \(\gamma _{0}\) and \(\gamma _{1}\), respectively, and s0 and s1 are used for \(\delta _{0}\) and \(\delta _{1}\). The variables vr and vs denote the corresponding sensor noise variances \(\sigma ^{2}_{v}\) and \(\sigma ^{2}_{w}\). Finally, ve, rho, and alpha denote the process noise variance \(\sigma ^{2}_{\varepsilon }\), the forgetting factor \(\rho \), and the \(\alpha \) term related to \(I_{k}\), respectively. Shown below is a brief code snippet showing the parameter initialization.
Also, base_prob (\(p_{0}\)) is still calculated based on the average probability of \(n_{k} = 1\) occurring in the data. The other variables x_pred, x_updt, and x_smth for \(x_{k|k - 1}\), \(x_{k|k}\), and \(x_{k|K}\) remain the same, as well as the corresponding v_pred, v_updt and v_smth variables for variance. There is a sequential progression in the code through \(k = 1, 2, \ldots , K\) and then through \(k = K, (K - 1), \ldots , 1\) at the state estimation step. The terms r0, r1, s0, s1, vr, vs, ve, rho, and alpha are calculated at the parameter estimation step. Shown below is a code snippet in the forward progression.
The code where we proceed in the reverse direction at the state estimation step is shown below. While it is largely similar to what we saw in an earlier chapter, now the variable rho is also included.
Note that in the examples where an external input is absent, alpha is not calculated. The state estimation step and the parameter estimation step are performed in turn until convergence.
5.4.1 Application to Skin Conductance and Sympathetic Arousal
This state-space model with one binary and two continuous observations was used in [29] for estimating sympathetic arousal from skin conductance. In the model, the tonic component made up the continuous variable \(s_{k}\). The other continuous variable \(r_{k}\) was derived somewhat differently. SCR amplitudes can have a skewed distribution which a log transformation can help correct. Therefore, the log of the SCR amplitudes was taken and interpolated over to generate \(r_{k}\).
A further point is to be noted with experimental data. The estimated state \(x_{k}\) can occasionally overfit to one of the continuous variables [29]. Consequently, an additional constraint was applied to allow the parameters corresponding to \(r_{k}\) and \(s_{k}\) (i.e., \(\gamma _{0}\), \(\gamma _{1}\), \(\sigma ^{2}_{v}\), \(\delta _{0}\), \(\delta _{1}\), and \(\sigma ^{2}_{w}\)) to update only if the sensor noise variance estimates did not differ by more than a certain amount. Details of this can be found in [29]. This constraint prevented one of the sensor noise variance estimates from being driven down at the expense of the other (which takes place during overfitting).
If the external inputs are unknown, the version of the code without \(\alpha I_{k}\) can be used. The experimental results in Fig. 5.1 are from a case where \(\alpha I_{k}\) is not considered. The data come from the stress experiment in [53] which we also considered two chapters ago. The portion of the experiment considered here consists of the cognitive stressors, relaxation, and the horror movie clip. The state estimates are high during the cognitive stressors and thereafter gradually diminish. However, the increase seen in the HAI at the beginning of the horror movie clip is quite significant.
Data from the Pavlovian fear conditioning experiment in [66] are taken for the experimental code example containing the \(\alpha I_{k}\) term. The results are shown in Fig. 5.2. The experiment is described in detail in [67, 68]. In a typical fear conditioning experiment, a neutral cue is paired with an unpleasant stimulus such as a painful electric shock. Through repeated pairing, a subject begins to display a response to the neutral cue alone. In the experiment in [66], two types of cues were used. One of the cues never preceded the electric shock. This is labeled the CS- cue. The second cue, labeled as CS+, preceded the shock 50% of the time. The code example sets \(I_{k} = 1\) at the locations of the neutral cues and the shocks. Other types of inputs may also be considered for \(I_{k}\). Figure 5.2 depicts the averages for the CS- trials, the CS+ trials that did not contain the electric shock, and the CS+ trials that did contain the shock. As seen in Fig. 5.2, for this particular subject, the CS+ with the shock elicited the highest skin conductance and sympathetic arousal responses. The CS- trials had the lowest skin conductance and arousal levels, and the CS+ without the shock had responses in-between these two.
References
D. S. Wickramasuriya and R. T. Faghih, “A Bayesian filtering approach for tracking arousal from binary and continuous skin conductance features,” IEEE Transactions on Biomedical Engineering, vol. 67, no. 6, pp. 1749–1760, 2020.
D. S. Wickramasuriya and R. T. Faghih, “A marked point process filtering approach for tracking sympathetic arousal from skin conductance,” IEEE Access, vol. 8, pp. 68 499–68 513, 2020.
J. Birjandtalab, D. Cogan, M. B. Pouyan, and M. Nourani, “A non-EEG biosignals dataset for assessment and visualization of neurological status,” in Proc. IEEE Int. Workshop .Signal Processing Systems, 2016, pp. 110–114.
D. R. Bach, G. Flandin, K. J. Friston, and R. J. Dolan, “Modelling event-related skin conductance responses,” Int. J. Psychophysiology, vol. 75, no. 3, pp. 349–356, 2010.
J. J. Braithwaite, D. G. Watson, R. Jones, and M. Rowe, “A guide for analysing electrodermal activity (EDA) & skin conductance responses (SCRs) for psychological experiments,” Psychophysiology, vol. 49, no. 1, pp. 1017–1034, 2013.
M. R. Amin and R. T. Faghih, “Tonic and phasic decomposition of skin conductance data: A generalized-cross-validation-based block coordinate descent approach,” in 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2019, pp. 745–749.
A. Greco, G. Valenza, A. Lanata, E. P. Scilingo, and L. Citi, “cvxEDA: A convex optimization approach to electrodermal activity processing,” IEEE Trans. Biomed. Eng., vol. 63, no. 4, pp. 797–804, 2016.
S. Maren, “Neurobiology of Pavlovian fear conditioning,” Annual Review of Neuroscience, vol. 24, no. 1, pp. 897–931, 2001.
M. R. Milad, S. Igoe, and S. P. Orr, “Fear conditioning in rodents and humans,” in Animal Models of Behavioral Analysis. Springer, 2011, pp. 111–132.
O. V. Lipp, “Human fear learning: Contemporary procedures and measurement,” Fear and Learning: From Basic Processes to Clinical Implications, no. 2001, pp. 37–51, 2006.
D. R. Bach, J. Daunizeau, K. J. Friston, and R. J. Dolan, “PsPM-HRA1: Skin conductance responses in fear conditioning with visual CS and electrical US,” Feb. 2017, See the readme file for more detail. Data are stored as .mat files for use with MATLAB in a format readable by the PsPM toolbox (pspm.sourceforge.net). This research was supported by Wellcome Trust grants 098362/Z/12/Z and 098362/Z/12/Z, and Swiss National Science Foundation grant PA00A-117384. [Online]. Available: https://doi.org/10.5281/zenodo.321641
——, “Dynamic causal modelling of anticipatory skin conductance responses,” Biological Psychology, vol. 85, no. 1, pp. 163–170, 2010.
M. Staib, G. Castegnetti, and D. R. Bach, “Optimising a model-based approach to inferring fear learning from skin conductance responses,” J. Neuroscience Methods, vol. 255, pp. 131–138, 2015.
Author information
Authors and Affiliations
5.1 Electronic Supplementary Material
Rights and permissions
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
Copyright information
© 2024 The Author(s)
About this chapter
Cite this chapter
Wickramasuriya, D.S., Faghih, R.T. (2024). State-Space Model with One Binary and Two Continuous Observations. In: Bayesian Filter Design for Computational Medicine. Springer, Cham. https://doi.org/10.1007/978-3-031-47104-9_5
Download citation
DOI: https://doi.org/10.1007/978-3-031-47104-9_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-47103-2
Online ISBN: 978-3-031-47104-9
eBook Packages: Biomedical and Life SciencesBiomedical and Life Sciences (R0)