# A Robot Learning Method with Physiological Interface for Teleoperation Systems
## 3 Method
### Learning Algorithm  
The demonstration data are high dimensional; therefore, it is difficult to find a function to describe the demonstration data globally. In this study, the locally weighted regression (LWR) algorithm was employed to explore the approximate function locally between the input and the output for the given aligned demonstration data.  
According to the demonstration data \(T=\{(x(i),\;y(i)),\;i=1,\;2,\;\ldots,\;N\}_{i}^{N}\), the local relationship between the output \(y(i)\) and the input \(x(i)\) can be obtained as follows:  
\[Y=\frac{\sum_{i=1}^{N}w(i)y(i)}{\sum_{i=1}^{N}w(i)}, \tag{8}\]  
where \(y(i)\) denote the output values of the \(ith\) local model, \(w(i)\) represent the weights of the \(y(i)\). In the learning algorithm, input \(x_{i}\) consists of the collected task trajectories \(P=\{P_{x},\;P_{y},\;P_{z}\}\) and the collected stiffness \(\bar{a}\). \(x_{i}\) are four-dimensional vectors, \(y_{i}\) are four-dimensional vectors.  
Figure 4: The cost matrix \(D\{L(x_{1}),L(x_{2})\}\) with minimum wrap path distance.  
Based on the receptive fields of the model, the weight \(w_{i}\) can be computed by Gaussian forms as follows:  
\[w(i)=exp\{-\frac{1}{\theta}(\textbf{x}-x(i))^{T}(\textbf{x}-x(i))\}, \tag{9}\]  
where **x** is the fitting position. \(\vartheta>0\) is used to adjust the Gaussian weight. \(\vartheta=2\) is used in this study. Equation (9) concludes that the weight value becomes larger as the input \(x(i)\) is near to the fitting position **x**.  
For the given input data \(x(i)\), the log likelihood for the probability \(p(y(i)|x(i))\) between \(y(i)\) and \(x(i)\) can be presented as  
\[\begin{split}\ell(\phi)&=log\{\Pi_{i=1}^{N}p(y(i)| x(i))\}\\ &=\sum_{i=1}^{N}log(\frac{w(i)}{2\pi})\frac{1}{2}-\frac{1}{2}\sum _{i=1}^{N}w(i)\{y(i)-\phi x(i)\}^{T}\{y(i)-\phi x(i)\},\end{split} \tag{10}\]  
where \(\phi\) is parameter vector of the LWR method.  
With  
\[p(y(i)|x(i)=(\frac{w(i)}{2\pi})^{\frac{1}{2}}\exp(-\frac{w(i)(y(i)-\phi x(i))^{ T}(y(i)-\phi x(i))}{2}). \tag{11}\]  
Inspired by literature reports [46; 47], the maximum of \(\ell(\phi)\) by minimizing the \(H(\phi)\) can be obtained as follows:  
\[H(\phi)=\frac{1}{2}\sum_{i=1}^{N}w(i)\{y(i)-\phi x(i)\}^{T}\{y(i)-\phi x(i)\}. \tag{12}\]  
On minimizing the \(H(\phi)\), we have  
\[\phi_{min}=argmin\ \{\frac{1}{2}\sum_{i=1}^{N}w(i)\{y(i)-\phi x(i)\}^{T}\{y(i)- \phi x(i)\}\}. \tag{13}\]  
By using partial derivatives notion for Equation (13), we obtain  
\[\begin{split}\frac{\partial\ell(\phi)}{\partial\phi}& =\sum_{i=1}^{N}w(i)(\phi x(i)-y(i))x(i)^{T}\\ &=\phi\sum_{i=1}^{N}w(i)x(i)x(i)^{T}-\sum_{i=1}^{N}w(i)y(i)x(i)^ {T}.\end{split} \tag{14}\]  
To set Equation (14) to be 0, a diagonal weight matrix \(W\) can be represented as follows:  
\[W=\left[\begin{array}{cccc}w(1)&0&\ldots&0\\ 0&w(2)&\ldots&0\\ &\ldots&&\\ 0&0&\ldots&w(N)\end{array}\right]. \tag{15}\]  
Based on Equations (14) and (15), the nonlinear model can be obtained as  
\[\phi=B^{T}WA(A^{T}WA)^{-1}, \tag{16}\]  
with  
\[A=\left[\begin{array}{c}x(1)^{T}\\ x(2)^{T}\\ \ldots\\ x(N)^{T}\end{array}\right], \tag{17}\]with  
\[B=\begin{bmatrix}y(1)^{T}\\ y(2)^{T}\\ \dots\\ y(N)^{T}\end{bmatrix}. \tag{18}\]  
After the task is learned by using the LWR method, the slave robot was operated according to the learned task trajectories and learned human stiffness.