where w g s and w e s denote weighting factors for structure s that are used to tune the trade-off between geometric and energetic contributions in the merit function. Some arguments have been omitted for clarity. While '1/2' prefactor will not affect the results of minimising M F s , its inclusion simplifies the subsequent analytical gradient expressions and also provides a parallel to the conventional form of a maximum likelihood estimation. Summing M F s over all structures, s = 1, ..., N S, where N S is the number of structures in the parameter training set, forms the Total Merit Function (T M F ). For a subset of the empirical parameters to be optimised p ⊆ p, optimal parameter estimates, p * , are obtained by solving Problem (PE).