# Inertial Parameter Identification in Robotics: A Survey
## 3 Inverse Dynamic Identification Model (IDIM) and Least-Squares (LS) Estimation Methods  
### Ordinary, Weighted and Iteratively Reweighted Least-Squares (IDIM-OLS, -WLS, -IRLS)  
Let \(\mathbf{Y}_{\beta}(\bar{\mathbf{q}},\mathbf{\dot{q}},\mathbf{q})=\partial\mathbf{\tau}_{idm}/ \partial\mathbf{\beta}\in\mathbb{R}^{n\times b}\) be the closed-form expression of the Jacobian matrix of \(\mathbf{\tau}_{idm}\) with respect to the vector \(\beta\) of base parameters, obtained by column rearrangements of the robot regressor matrix \(Y_{\chi}(\bar{\mathbf{q}},\mathbf{\dot{q}},\mathbf{q})\) following \(Y_{\beta}(\bar{\mathbf{q}},\mathbf{\dot{q}},\mathbf{q})=Y_{\chi}(\bar{\mathbf{q}},\mathbf{\dot{q}},\mathbf{q})\overline{P}\)with \(\overline{P}\) the permutation matrix defined in Section 2.2. Then (1) can be rewritten in the following form:  
\[\tau_{idm}=Y_{\beta}\big{(}\bar{q},\dot{q},q\big{)}\beta, \tag{17}\]  
In practice, because of the uncertainties caused by measurement noises and modeling errors, the actual torque \(\tau\) differs from \(\tau_{idm}\) by an error \(\mathbf{e}\in\mathbb{R}^{n}\) so that (17) becomes  
\[\tau=\Upsilon_{\beta}\big{(}\bar{q},\dot{q},q\big{)}\beta+\mathbf{e}\,. \tag{18}\]  
Equation (18) represents the Inverse Dynamic Identification Model (IDIM) relation (c.f. [43] and the references therein). The IDIM is sampled at a rate \(f\) while the robot is tracking exciting trajectories during an experiment. For \(N\) collected samples, an over-determined linear system of \(n\cdot N\) equations and \(b\) unknowns is obtained  
\[\mathbf{y}_{\tau}=\mathbf{W}(\bar{q},\dot{q},q)\beta+\mathbf{e}\,, \tag{19}\]  
where \(\mathbf{y}_{\tau}\in\mathbb{R}^{n\cdot N}\) is the sampled vector of \(\tau\); \(\mathbf{W}(\bar{q},\dot{q},q)\in\mathbb{R}^{(n\cdot N)\times b}\) is the sampled matrix of \(\Upsilon_{\beta}\big{(}\bar{q},\dot{q},q\big{)}\), referred to as _observation matrix_; and \(\mathbf{e}\in\mathbb{R}^{n\cdot N}\) is the sampled vector of \(\mathbf{e}\). For the sake of compactness, \(\mathbf{W}(\bar{q},\dot{q},q)\) will be noted \(\mathbf{W}\) in the rest of this work. Please note that \(\mathbf{e}\) is here assumed to be serially uncorrelated, zero-mean and heteroskedastic, with a diagonal covariance matrix \(\mathbf{\Sigma}\). This choice is justified in [6,44] by the fact that robots are nonlinear multi-input multi-output (MIMO) systems. The most popular approach to solving (19) consists of computing the weighted least-squares estimate \(\hat{\mathbf{\beta}}_{WLS}\) and associated covariance matrix \(\mathbf{\Sigma}_{WLS}\)  
\[\hat{\mathbf{\beta}}_{WLS} =(\mathbf{W}^{\top}\mathbf{\Sigma}^{-1}\mathbf{W})^{-1}\mathbf{W}^{\top}\mathbf{ \Sigma}^{-1}\mathbf{y}_{\tau}\,, \tag{20}\] \[\mathbf{\Sigma}_{WLS} =\left(\mathbf{W}^{\top}\mathbf{\Sigma}^{-1}\mathbf{W}\right)^{-1},\]  
The diagonal terms \(\Sigma_{jl}\) of \(\mathbf{\Sigma}\) can be evaluated from the ordinary least-squares solution of (19), following the guidelines of [2]  
\[\forall j\in\{1\cdots n\},\;\Sigma_{jl}=\frac{\left\|\mathbf{\varepsilon}_{OLS_{j }}\right\|}{N-b}. \tag{21}\]  
where \(\mathbf{\varepsilon}_{OLS_{j}}\) denotes the IDIM-OLS sampled error vector for joint \(j\). Note that a correlation between the measured joint torque signals will result in non-negligible off-diagonal terms in \(\mathbf{\Sigma}\). However, these terms can still be estimated using for instance the method of [23]. This method is both simple to implement and computationally efficient. In addition, it was successfully applied to multiple existing systems such as cars [45], electrical motors [46] or compactors [47]. It is worth noting that the vulnerability of OLS and WLS to outliers can be addressed using a specific Huber estimator (c.f. [48,49]). This is referred to as the Iteratively Reweighted Least-Squares (IRLS) in [50].