## 2 Materials and Methods
### Procedures
#### 2.4.1 Data Processing
The largest Lyapunov exponent (LyE) was used to assess the stability of movement trajectories, capturing their divergence or convergence over time [35]. The multiscale entropy (MSE) quantified the complexity of the system, reflecting its adaptability and variability. Both measures were computed using custom scripts developed in MATLAB (version R2020b, The MathWorks, Inc, Natick, MA, USA.). Multiscale entropy (MSE) is a validated method for analyzing the complexity of time series data across multiple scales, effectively distinguishing complex dynamics in physiological signals [75; 76]. MSE used \"sample entropy\" to estimate the regularity in different time scales, based on the approximate entropy, to assess the complexity degree [77]. The Complexity Index (CI) served as the primary dependent variable to examine the differences between stroke and healthy groups. The CI was evaluated for the COP parameters (POS, DISP, and MVEL) and the angular variables (POS and MDISP) across the AP, ML, and X, Y, and Z directions, respectively. The analysis followed the methodologies described by [PERSON] et al. [76] and [PERSON] et al. [78]. Initially, the sample entropy (SE) [79] was computed (Equation (1)):  
\[SE(m,r,N)=-\text{ln}\frac{Um+1(r)}{Um(r)} \tag{1}\]  
where \(SE\) is the sample entropy value, \(m\) is the number of samples being compared (\(m=2\)), \(r\) is the similarity threshold (0.2 \(\times\) of standard deviation signal), \(N\) is the number of samples (66 points), and \(U\) indicates the probability of the samples falling within \(r\). The original time series was processed using a coarse-graining procedure (Equation (2)), enabling the evaluation of complexity across two-time scales:  
\[y_{j}^{\tau m}=\left(\frac{1}{\tau m}\right)\sum_{i=(j-1)\tau m+1}^{j\tau}x_{ 1},1\leq j\leq\frac{N}{\tau m} \tag{2}\]where \({y_{j}}^{\tau m}\) represents the new time series, which is generated by averaging non-overlapping data points from the original time series based on the scale factor (\(\tau_{m}\)). This coarse-graining process facilitates the calculation of sample entropy (SE) across all time scales, ranging from 1 to \(\tau_{m}\). The Complexity Index (CI) is derived through the numerical integration of individual \(SE\) values across all calculated time scales, as outlined in Equation (3):  
\[C_{1}=\sum_{j=1}^{N}S_{E}(i) \tag{3}\]  
where \(SE\) represents the complexity value calculated at each individual time scale (\(i\)). The LyE algorithm, as initially proposed by [PERSON] et al. [80]: can be expressed through a single equation. In this formulation, \(L\) represents the distance between points, \(t\) denotes the time lag, and \(M\) refers to the total count of replacement steps [79]:  
\[\lambda(i)=\frac{1}{M}{\sum_{K=K_{min}}^{Kmax}}\bigg{(}\frac{1}{K.t}ln\frac{L _{i+K}}{L_{i}}\bigg{)} \tag{4}\]  
The LyE exponent is a key measure used to evaluate the chaotic behaviour of postural sway, determining how movement trajectories diverge or converge over time [35]. Positive values indicate the divergence of trajectories, reflecting greater instability and chaotic dynamics [81]. Conversely, negative values exhibit convergent trajectories, suggesting more robust postural control [82]. This measure highlights the adaptive complexity of the PC system, balancing between stability and chaos in response to varying task demands [35]. To calculate the LyE, the phase space was reconstructed following the method described by [PERSON] [83,84]. This process involved generating multiple delayed copies of the time series, defined by a time lag (\(\tau\)), to enable state space reconstruction for non-linear parameter estimation. In this study, a time lag of \(\tau=1\) and an embedding dimension of m = 2 were chosen, considering prior methodological insights and the relatively simple nature of the system being examined [85]. The algorithm measures the divergence or convergence of trajectories within the reconstructed phase space, offering a quantitative assessment of the system's sensitivity to initial conditions [86].