To calculate the least-squares anchor elemental potentials, we take the elemental composition matrix N that contains all the formation reactions of the target species from the constituent elements to derive the chemical potentials. Rather than selecting a set of explicit anchor species with defined stoichiometries, we seek the set of chemical potentials that minimizes the squared magnitude of the resulting relative enthalpies. The linear algebra formulation offers a convenient way to perform the minimization of squared relative enthalpies magnitudes, which is closely related to the least-squares regression problem and is given in Eq. (47).