# Minimization process¶

## Least mean squares¶

Experimental curves are fitted with models using the least mean squares method. The method of least squares is a standard approach in regression analysis band is based on the resolution of the following problem, by finding the coefficients \(x\) :

(1)¶\[\underset{x}{\mathrm{min}} \| F(x,xdata)−ydata \|_2^2 = \underset{x}{\mathrm{min}} \sum_{\substack{i}} (F(x,xdata_\text{i})−ydata_\text{i})^2\]

With given input data \(xdata\) and the observed output \(ydata\).

- Matlab Optimization toolbox.
- Matlab nonlinear curve-fitting.
- Least squares method.
- Curve fitting.
- Mathematical optimization.

Fischer-Cripps A.C. wrote a detailed section about the non-linear least squares fitting in his book “Nanoindentation” (pp. 253-256) [1].

[1] | Fischer-Cripps A.C., “Nanoindentation” Springer 3rd Ed. (2011). |

## Residuals¶

The residuals from a fitted model are the differences between the response data and the corresponding prediction of the response computed using the regression function. Mathematically, the definition of the residual for the ith observation in the data set is written :

(2)¶\[r_\text{i} = y_\text{i} − \hat{y}_\text{i}\]

With \(y_\text{i}\) denoting the ith response value and \(\hat{y}_\text{i}\) the ith predicted response value.

If the model fits the data correctly, the residuals approximate the random errors.