First of all, the name least-squares minimization is really the wrong name for the algorithm that crystallography uses, which is really called Gauss-Newton minimization (yes, that Gauss [Carl Friedrich] and that Newton [Isacc]). The name least-squares is because we want to minimize the function,
\[\chi ^2 = \sum _j^N w_j(y_{obs,j}-y_{calc,j})^2\] meaning that we want to minimize the sum of the squares of the differences between what we have observed, \(y_{obs,j}\), and what is predicted by our model, \(y_{calc,j}\). We have \(N\) observations and we weight the observations by \(w_j\). Note that this is the definition GSAS-II uses for \(\chi ^2\). Some people defined that as what GSAS-II calls the Reduced \(\chi ^2\) (see 8.3). The weights here are important. Smarter people than I have shown that if the errors on \(y_{obs,j}\) are purely statistical (meaning that there is no systematic error), then the optimum minimum will be obtained when \(w_j= 1 / \sigma ^2_j\) where \(\sigma _j\) is the standard uncertainty on observation \(y_{obs,j}\). So, take-home message #1 here is that knowing the uncertainties on the observations is needed to find the best model for the data. It is also worth noting that if restraints (see Chapter 25) are defined, they are treated in this as if they were data points. If we place a restraint on a bond distance, then the \(y_{obs,j}\) value will be the target value we specify for that distance and \(y_{calc,j}\) will be the value for the bond distance based on the atom coordinates in the current version of the model.
Since the values for \(y_{calc,j}\), whether data or restraints, are computed from our model, it makes sense to consider our model as a function that predicts values for the observables, \(M(\mathbf {p},x)\), based on the parameters, \(\mathrm {p}\), which is a vector of values and \(x\) represents the dependent variable(s). Thus, rather than having a set of discrete calculated points, we have a continuous function that predicts the observables, with \(y_{calc,j} = M(\mathrm {p}, x_j)\).