The classical approach to phasing as described in Sec. has been implemented in the program MLPHARE . The program is based on the phase refinement procedure  whereby the isomorphous and anomalous lack of closures ( and ) are minimised for each derivative using least-squares methods.
Earlier phasing programs calculated an initial set of phases from the combination of derivative phase probability distributions  and then refined the adjustable parameters for each derivative against those phases. This however led to the introduction of bias into the refinement procedure due to the fact that the phases and the refined parameters were highly correlated with one another. This was overcome initially by doing heavy atom refinement for any one derivative against a set of phases calculated by excluding the contribution of that derivative. This avoided bias but reduced the amount of information present in any one refinement.
Bricogne  showed that the application of maximum likelihood theory to the problem of phase refinement enabled all the phase information to be used without introduction of bias.
The likelihood function used in MLPHARE is based upon the assumptions of Blow & Crick  and takes the form
where is the lack of closure and is the overall error as defined by Eq. .
Likelihood functions are calculated using the isomorphous and anomalous lack of closures ( and ) for each derivative at regular intervals of around the phase circle. The individual likelihood functions are then multiplied together to give a global likelihood function which is then maximised during the refinement procedure with respect to i) the scales and temperature factors of the derivative data sets with respect to the reference set, ii) the heavy atom positions, atomic temperature factors, and occupancies and iii) the estimated overall errors.
When performing phase refinement of MAD data where the and values vary between each data set any uncertainty in the experimentally measured values of the anomalous scattering factors is accounted for by defining two separate occupancy factors (isomorphous () and anomalous ()) which have the anomalous scattering factor terms included. The occupancy factors produced by MLPHARE therefore do not give a measure of the absolute occupancies of the heavy atoms but can give an indication of the relative anomalous signal being observed at each X-ray energy. For data which have been placed on an absolute scale, isomorphous and anomalous occupancies of unity correspond to a heavy atom which occupies its site in every protein molecule in the crystal and has scattering factors, () and , corresponding to their theoretical values for radiation at (Å). This inevitably means that when used with MAD data which lacks a true native data set, the isomorphous occupancies are much smaller than the anomalous occupancies because the scattering factors play no role in the phasing procedure.
During the refinement the contribution that each data set is making to the phasing may be judged by inspecting the values of several R-factors which are a measure of the average Bijvoet or dispersive anomalous differences to their respective lack of closures. For isomorphous (dispersive) differences in acentric reflections a Cullis type R-factor  may be quoted where
and for centric reflections we may use
For anomalous differences we equivalently define
All Cullis R-factor values should be less than unity.