# Donning/Doffing and Arm Positioning Influence in Upper Limb Adaptive Prostheses Control
## Materials and Methods
### Method  
Our model controlled two independent degrees of freedom (DoF). Since we used a regression model, all movements (single DoF activation or combined) were allowed at any time instead of the classical classification approaches where the input signals are mainly mapped into discrete movements [9; 10; 20; 21; 22; 50]. In this scenario, both degrees of freedom correlate independent movements, so we modeled each one separately. The current position is estimated based on the previous one and the myoelectric input signal generated by the user during forearm muscle contractions. Mathematically, the problem can be stated as an ARMA(1,_q_) linear system:  
\[y_{i}(t)=a_{i}(t)y_{i}(t-1)+\sum_{k=0}^{q}\mathbf{b}_{i,k}^{T}(t)\mathbf{x}(t-k ),\quad i=1,2 \tag{3}\]  
Figure 1: Myo Armband positioning in the forearm of an able bodied participant. where \(y_{i}(t),i=1,2\) are the current position in each direction, \(y_{i}(t-1)\) the previous ones, \(a_{i}(t)\) the two feedback coefficients to be estimated, \(\mathbf{b}_{i,k}(t)\) the input signal filters that must also be estimated and \(\mathbf{x}(t)\) the input signals, i.e., the RMS feature vector obtained from the myoelectric activity using Equation (1). The order \(q\) of the FIR filter must be chosen according to the sampling frequency and the signal to noise level. In this study, we used the simplified equation where the input has no memory, i.e., \(q=0\), since the signals have enough power and the reaction time between the visual stimulus and the muscular response is almost immediate [51]. Assuming \(q=0\), the final model reads:  
\[y_{i}(t)=a_{i}(t)y_{i}(t-1)+\sum_{j=1}^{M}b_{i,j}(t)x_{j}(t),\quad i=1,2 \tag{4}\]  
where \(M\) is the number of myoelectric channels, in our case \(M=8\). The goal in Equation (4) is to obtain the coefficients \(a_{i}(t)\) and the filters \(\mathbf{b}_{i}(t)\) that minimize the mean squared error between the real target position \(d_{i}(t)\) and the estimated one \(y_{i}(t)\):  
\[\varepsilon_{MSE}(t)=\sum_{i=1}^{2}E\left\{\left(d_{i}(t)-y_{i}(t)\right)^{2}\right\} \tag{5}\]  
This is a regression problem where the system is modeled by an ARMA(1,0) filter with unknown AR part \(a_{i}(t)\) and MA part \(\mathbf{b}_{i}(t)\). The filters were learned by the algorithm during a real-time training session. To solve Equation (4), we need an adaptive solution since it must work in real time, i.e., for each new input signal, we must obtain an estimated output position. As the actual position depends recursively on previous estimated positions, the error is a non linear function of the parameters. In [49], we presented an adaptive algorithm with a recursive Gauss-Newton updating rule. We summarize here the algorithm (see [49] for details about the derivation for the general ARMA(\(p\),\(q\)) case). To simplify the notation, we concatenated in one column vector \(\beta(t)\) all the coefficients to be estimated. Each movement direction has one coefficients vector: \(\beta_{i}(t)=[a_{i}(t),b_{i,1}(t),\dots,b_{i,M}(t)]^{T}\), \(i=1,2\). First, all parameters were initialized; the initial coefficients were set to zero: \(a_{1}(0)=a_{2}(0)=0\), and \(\mathbf{b}_{1}(0)=\mathbf{b}_{2}(0)=[0,0,\dots,0]^{T}\). The initial position was considered at the origin \((y_{1}(0),y_{2}(0))=(0,0)\), and two matrices used for the coefficients update were initialized randomly, \(\mathbf{P}_{1}(0)=\mathbf{P}_{2}(0)=\alpha\mathbf{I}\), with \(\alpha\) a small value and \(\mathbf{I}\) the identity matrix. Two additional auxiliary filtered versions of the input \(\tilde{\mathbf{x}}_{i}(t)\) and output \(\tilde{y}_{i}(t)\) signals for each movement are defined and concatenated in a column vector \(\tilde{\mathbf{z}}_{i}(t)=[\tilde{y}_{i}(t-1),\tilde{x}_{i,1}(t),\dots,\tilde{ x}_{i,M}(t)]^{T}\). Each sample \(\mathbf{x}(t)=[x_{1}(t),\dots,x_{M}(t)]^{T}\) obtained as it is explained in the Data Acquisition section fed the algorithm. For each observation and direction, the following calculations were carried out:  
1.