## 2 Materials and Methods
### Modelling
#### 2.2.2. SISO TF Modelling  
Firstly, SISO TF models were used to identify the relationship between the input \(u(k-\delta)\), which is a step input around the emotion, consisting in the period right before and after the emotion label, and the output \(y(k)\), the mental HR ([bpm]) response associated with it.  
\[y(k)\ =\ \frac{B\big{(}z^{-1}\big{)}}{A(z^{-1})}\ u(k-\delta)+\xi(k) \tag{2}\]  
\(u(k-\delta)\) is the assumed deterministic binary step input of the system, with time delay \(\delta\) (min), which is given the value 1 when the considered data point was labelled as an emotion and a value of 0 otherwise. The period right before and after the step input have the same duration as the emotion itself. This is visually clarified in Figure 4.  
\[u(k-\delta)\ =\ \begin{cases}0&\quad\quad\text{$if$ no emotion labelled}\\ 1&\quad\quad\text{$if$ emotion labelled}\end{cases} \tag{3}\]  
\(y(k)\) is the output of the TF system; in this case, the mental HR component. Except for the input to the system, the output is also influenced by external contributions that were not manipulated by the participant, namely disturbing factor \(\xi(k)\). This disturbing factor is assumed to be a random variable with zero mean and accounts for the effects of unmodelled inputs, measured noise and modelling errors [38].  
\(A\big{(}z^{-1}\big{)}\) and \(B\big{(}z^{-1}\big{)}\) are the model polynomials.  
\[A\left(z^{-1}\right)\ =\ 1+a_{1}z^{-1}+a_{2}z^{-2}+\ldots+a_{n_{a}}z^{-n_{a}} \tag{4}\]  
\[B\left(z^{-1}\right)\ =\ b_{0}+b_{1}z^{-1}+b_{2}z^{-2}+\ldots+a_{n_{b}}z^{-n_{b}} \tag{5}\]  
\(a_{j}\) and \(b_{j}\) are the denominator and numerator model parameters, respectively, that have to be estimated, and \(n_{a}\) and \(n_{b}\) are the denominator and numerator polynomial orders. \(z^{-1}\) is called the backward shift operator, meaning that \(z^{-1}y(k)\ =\ y(k-1)\)[39].  
The goal of DBM modelling was to determine the optimal TF model structure, defined by the triad [\(n_{a}\ n_{b}\ \delta\)], and to estimate the optimal model parameters. To determine the model structure, the 'rivid' function of the CAPTAIN toolbox was used, which searched for all possible triads with nominator and denominator polynomials between zero and five, and a time delay between zero and 500 min, with the refined instrumental variable (RIV) approach [36]. The top twenty best models are ranked by increasing Young Information  
Figure 4: Step input to the SISO TF model.  
Figure 3: Single-input single-output (SISO) TF model to be identified in the data-based mechanistic modelling.  
Criterion (YIC). The YIC judges models based on their accuracy, complexity and reliability of the parameter estimations [39].  
\[\text{YIC }= log_{e}\Bigg{(}\frac{\sigma_{e}^{2}}{\sigma_{y}^{2}}\Bigg{)}+ log_{e}\Bigg{(}\frac{1}{h}\sum_{i=1}^{h}\frac{\sigma_{e}^{2}\beta_{ii}}{ \hat{a}_{i}^{2}}\Bigg{)} \tag{6}\]  
In the equation, \(\sigma_{e}^{2}\) and \(\sigma_{y}^{2}\) are the variances of the model errors and data around the mean, respectively. \(h\) is the number of estimated parameters, \(\beta_{ii}\) are the diagonal elements of the covariance matrix from the parameter estimations and \(\hat{a}_{i}^{2}\) the square value of the i-th parameter [38; 39]. YIC values have to be as low as possible.  
First-order models rise without an overshoot in the mental HR response, while higher-order models do have an overshoot in the response. The results were compared to literature about emotion duration, defined as the interval between the start and end of an emotional episode.